Skip to content

Commit

Permalink
Enable tests in CodingStyle directory (#4340)
Browse files Browse the repository at this point in the history
* Enable tests in CodingStyle directory

* Enable PHP short open tags in TravisCI

* Fix phpunit.xml indentation

* Use HHVM-specific ini file

* Check hhvm.enable_short_tags instead of short_open_tag on HHVM
  • Loading branch information
mlocati authored and aembler committed Sep 5, 2016
1 parent 9927528 commit 336b6ba
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ matrix:
- php: nightly

before_script:
- if [[ $TRAVIS_PHP_VERSION = hhvm ]]; then cat tests/travis.hhvm.ini >> /etc/hhvm/php.ini; else phpenv config-add tests/travis.php.ini; fi
- travis_retry composer install --no-interaction
- mysql -e "SET GLOBAL sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,ONLY_FULL_GROUP_BY'"
- phpunit --version
Expand Down
5 changes: 3 additions & 2 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
backupStaticAttributes="false">
<testsuites>
<testsuite name="Tests">
<directory>tests/tests/Core/</directory>
<directory>tests/tests/Asset/</directory>
<directory>tests/tests/Block/</directory>
<directory>tests/tests/Attribute/</directory>
<directory>tests/tests/AttributeValue/</directory>
<directory>tests/tests/Block/</directory>
<directory>tests/tests/CodingStyle/</directory>
<directory>tests/tests/Core/</directory>
<directory>tests/tests/Localization/</directory>
</testsuite>
</testsuites>
Expand Down
6 changes: 5 additions & 1 deletion tests/tests/CodingStyle/NoShortTagsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ class NoShortTagsTest extends \Concrete\Tests\CodingStyleTestCase
*/
public function testNoShortTags($phpFile)
{
$sot = ini_get('short_open_tag');
if (defined('HHVM_VERSION')) {
$sot = ini_get('hhvm.enable_short_tags');
} else {
$sot = ini_get('short_open_tag');
}
if (empty($sot)) {
static::markTestSkipped('short_open_tag must be enabled in order to run the test '.__CLASS__.'::'.__FUNCTION__);

Expand Down
1 change: 1 addition & 0 deletions tests/travis.hhvm.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hhvm.enable_short_tags = On
1 change: 1 addition & 0 deletions tests/travis.php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
short_open_tag = On

0 comments on commit 336b6ba

Please sign in to comment.