Skip to content

Commit

Permalink
Correct test for PHP >= 7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyklay committed Nov 26, 2018
1 parent 07e58f5 commit e15e1ab
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 24 deletions.
42 changes: 21 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,27 @@ before_script:
script:
- zephir --ansi
- |
# Running tests
if [ "$(php-config --vernum)" -lt "70000" ]; then
test_suite="Extension_Php56"
elif [ "$(php-config --vernum)" -lt "70200" ]; then
test_suite="Extension_Php70"
else
test_suite="Extension_Php72"
fi
php \
-d extension=ext/modules/test.so \
vendor/bin/simple-phpunit \
--colors=always \
--bootstrap unit-tests/ext-bootstrap.php \
--testsuite $test_suite
php \
-d extension=ext/modules/test.so \
vendor/bin/simple-phpunit \
--colors=always \
--testsuite Zephir
if [ "$(php-config --vernum)" -lt "70000" ]; then
test_suite="Extension_Php56"
elif [ "$(php-config --vernum)" -lt "70200" ]; then
test_suite="Extension_Php70"
else
test_suite="Extension_Php72"
fi
php \
-d extension=ext/modules/test.so \
vendor/bin/simple-phpunit \
--colors=always \
--bootstrap unit-tests/ext-bootstrap.php \
--testsuite $test_suite
- |
php \
-d extension=ext/modules/test.so \
vendor/bin/simple-phpunit \
--colors=always \
--testsuite Zephir
after_success:
- .ci/after-success.sh
Expand Down
7 changes: 6 additions & 1 deletion test/oo/ooparams.zep
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ class OoParams
return average;
}

public function setStrictName(string! name)
public function setStrictNameFromZephirLand()
{
return this->setStrictName(12345);
}

public function setStrictName(string! name) -> string
{
return name;
}
Expand Down
4 changes: 2 additions & 2 deletions unit-tests/Extension/TypeHinting/AbstractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class AbstractTest extends TestCase
*/
public static function setUpBeforeClass()
{
if (\PHP_VERSION_ID < 70000) {
throw new SkippedTestError('Scalar type hint are avalibale in PHP 7 only');
if (\PHP_VERSION_ID < 70200) {
throw new SkippedTestError('Scalar type hints are available since PHP 7.2');
}
}

Expand Down

0 comments on commit e15e1ab

Please sign in to comment.