From 36c6b6d536e5deb85fcc38cea046e6ec3d17b0b6 Mon Sep 17 00:00:00 2001 From: Kosta Harlan Date: Wed, 10 Jul 2019 13:41:44 -0400 Subject: [PATCH] Tests: Assert that integration tests are not in unit test directory Bug: T87781 Change-Id: If82efb1829095a6cf76435921f1328801508a70a --- tests/phpunit/MediaWikiIntegrationTestCase.php | 5 +++++ 1 file changed, 5 insertions(+) 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' ) ); -- 2.20.1