From: Kosta Harlan Date: Wed, 10 Jul 2019 17:41:44 +0000 (-0400) Subject: Tests: Assert that integration tests are not in unit test directory X-Git-Tag: 1.34.0-rc.0~1089^2 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=36c6b6d536e5deb85fcc38cea046e6ec3d17b0b6;hp=7388b7b62b842ef1e80faa677656a26a90803ece;p=lhc%2Fweb%2Fwiklou.git Tests: Assert that integration tests are not in unit test directory Bug: T87781 Change-Id: If82efb1829095a6cf76435921f1328801508a70a --- diff --git a/tests/phpunit/MediaWikiIntegrationTestCase.php b/tests/phpunit/MediaWikiIntegrationTestCase.php index bba9d5ad73..07d135de8d 100644 --- a/tests/phpunit/MediaWikiIntegrationTestCase.php +++ b/tests/phpunit/MediaWikiIntegrationTestCase.php @@ -540,6 +540,11 @@ abstract class MediaWikiIntegrationTestCase extends PHPUnit\Framework\TestCase { protected function setUp() { parent::setUp(); + $reflection = new ReflectionClass( $this ); + // TODO: Eventually we should assert for test presence in /integration/ + if ( strpos( $reflection->getFilename(), '/unit/' ) !== false ) { + $this->fail( 'This integration test should not be in "tests/phpunit/unit" !' ); + } $this->called['setUp'] = true; $this->phpErrorLevel = intval( ini_get( 'error_reporting' ) );