zendframework / zend-test

Test component from Zend Framework
BSD 3-Clause "New" or "Revised" License
18 stars 38 forks source link

phpunit 6 check "_" in src/ path and expectException() and expectExceptionMessage() #43

Closed samsonasik closed 7 years ago

samsonasik commented 7 years ago

ping @Ocramius in favor of #40 which inside src/ was still no classalias of `PHPUnitclass, and defineexpectException()andexpectExceptionMessage()` if no exists.

It should compat with phpunit 4, 5, and 6 now.

samsonasik commented 7 years ago

hm.., phpunit 4 seems keep failing with error:

1) ZendTest\Test\PHPUnit\Controller\AbstractConsoleControllerTestCaseTest::testAssertResponseStatusCode

Failed asserting response code "1", actual status code is "0"
samsonasik commented 7 years ago

@Ocramius how about remove phpunit 4 support?

froschdesign commented 7 years ago

@samsonasik

I think, the answer is really simple:

samsonasik commented 7 years ago

@froschdesign I've tried use ^5.0 || ^6.0. But it seems the 5.0 I keep get error:

1) ZendTest\Test\PHPUnit\Controller\AbstractConsoleControllerTestCaseTest::testAssertResponseStatusCode
Failed asserting response code "1", actual status code is "0"

As with dependency lowest, it install exact phpunit 5.0 which expectException() and expectExceptionMessage() not exists yet, and it seems I am wrongly make redefine the compat, any suggestion for make it compatible ?

froschdesign commented 7 years ago

@samsonasik

samsonasik commented 7 years ago

@froschdesign thank you. I've updated to use phpunit ^5.7 || ^6.0 and update .travis.yml in favor of #39 .

Travis should be green now ;)

samsonasik commented 7 years ago

@froschdesign @Ocramius travis green ;)

samsonasik commented 7 years ago

@froschdesign @Ocramius should be ready for merge now ;)

samsonasik commented 7 years ago

@Koopzington I used your config .travis.yml at #39 and it seems one of travis got silent error:

0.40s$ if [[ $TEST_COVERAGE == 'true' ]]; then composer upload-coverage ; fi

> coveralls -v

sh: 1: coveralls: not found

Script coveralls -v handling the upload-coverage event returned with error code 127

could you verify ? see: https://travis-ci.org/zendframework/zend-test/jobs/199399047

michalbundyra commented 7 years ago

@samsonasik I think you are missing two things:

env:
  global:
    [...]
    - COVERAGE_DEPS="satooshi/php-coveralls"

and:

install:
  - if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi
samsonasik commented 7 years ago

@webimpress your comment already closed by a lot of diff closed. what do you mean with remove: --ignore-platform-reqs ? from what ?

michalbundyra commented 7 years ago

@samsonasik in afa49d0 you've added back PHP 5.6 with latest dependencies, but this is wrong, because you have global env: COMPOSER_ARGS="--no-interaction --ignore-platform-reqs" so it tries to install PHPUnit 6.0 on PHP5.6 - which is not supported. Please change this global env to: COMPOSER_ARGS="--no-interaction" and than all should be fine.

You can also make more changes in travis configuration to be consistent with other zend repositories, please see for example: https://github.com/zendframework/zend-expressive/blob/master/.travis.yml

samsonasik commented 7 years ago

@webimpress actually, the errow when using --ignore-platform-reqs on php 5.6 is on phpunit run itself:

> phpunit --colors=always

This version of PHPUnit is supported on PHP 7.0 and PHP 7.1.

You are using PHP 5.6.5 (/home/travis/.phpenv/versions/5.6.5/bin/php).

Script phpunit --colors=always handling the test event returned with error code 1
samsonasik commented 7 years ago

@webimpress ok, done

samsonasik commented 7 years ago

now it error on php 7+ with locked dependencies:

$ travis_retry composer install $COMPOSER_ARGS

Loading composer repositories with package information

Installing dependencies (including require-dev) from lock file

Your requirements could not be resolved to an installable set of packages.

  Problem 1

    - Installation request for doctrine/instantiator 1.0.2 -> satisfiable by doctrine/instantiator[1.0.2].

    - doctrine/instantiator 1.0.2 requires php ~5.3 -> your PHP version (7.0.15) does not satisfy that requirement.

  Problem 2

    - doctrine/instantiator 1.0.2 requires php ~5.3 -> your PHP version (7.0.15) does not satisfy that requirement.

    - phpunit/phpunit-mock-objects 3.4.1 requires doctrine/instantiator ^1.0.2 -> satisfiable by doctrine/instantiator[1.0.2].

    - Installation request for phpunit/phpunit-mock-objects 3.4.1 -> satisfiable by phpunit/phpunit-mock-objects[3.4.1].
samsonasik commented 7 years ago

I've updated composer.lock with updated COMPOSER_ARGS="--no-interaction"

samsonasik commented 7 years ago

@Ocramius @froschdesign @webimpress travis green again \m/ . Thanks ;)

weierophinney commented 7 years ago

I missed this when I created and merged #48, but this is now fully supported.