aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/unit/includes/utils/ClassCollectorTest.php
diff options
context:
space:
mode:
authorLegoktm <legoktm@member.fsf.org>2019-06-13 23:00:08 +0000
committerLegoktm <legoktm@member.fsf.org>2019-06-13 23:00:08 +0000
commit4e35134f7a3228a8195a07f49c85188e57ab8487 (patch)
treed9750a18496af4c52eb5dfce56f0d0b79fbd32cb /tests/phpunit/unit/includes/utils/ClassCollectorTest.php
parent0a2b996278e57a8b8c5377cd3a3eaa54f993d4a9 (diff)
downloadmediawikicore-4e35134f7a3228a8195a07f49c85188e57ab8487.tar.gz
mediawikicore-4e35134f7a3228a8195a07f49c85188e57ab8487.zip
Revert "Separate MediaWiki unit and integration tests"
This reverts commit 0a2b996278e57a8b8c5377cd3a3eaa54f993d4a9. Reason for revert: Broke postgres tests. Change-Id: I27d8e0c807ad5f0748b9611a4f3df84cc213fbe1
Diffstat (limited to 'tests/phpunit/unit/includes/utils/ClassCollectorTest.php')
-rw-r--r--tests/phpunit/unit/includes/utils/ClassCollectorTest.php60
1 files changed, 0 insertions, 60 deletions
diff --git a/tests/phpunit/unit/includes/utils/ClassCollectorTest.php b/tests/phpunit/unit/includes/utils/ClassCollectorTest.php
deleted file mode 100644
index 9c7c50f0f6e4..000000000000
--- a/tests/phpunit/unit/includes/utils/ClassCollectorTest.php
+++ /dev/null
@@ -1,60 +0,0 @@
-<?php
-
-/**
- * @covers ClassCollector
- */
-class ClassCollectorTest extends PHPUnit\Framework\TestCase {
-
- use MediaWikiCoversValidator;
-
- public static function provideCases() {
- return [
- [
- "class Foo {}",
- [ 'Foo' ],
- ],
- [
- "namespace Example;\nclass Foo {}\nclass Bar {}",
- [ 'Example\Foo', 'Example\Bar' ],
- ],
- [
- "class_alias( 'Foo', 'Bar' );",
- [ 'Bar' ],
- ],
- [
- "namespace Example;\nclass Foo {}\nclass_alias( 'Example\Foo', 'Foo' );",
- [ 'Example\Foo', 'Foo' ],
- ],
- [
- "namespace Example;\nclass Foo {}\nclass_alias( 'Example\Foo', 'Bar' );",
- [ 'Example\Foo', 'Bar' ],
- ],
- [
- "class_alias( Foo::class, 'Bar' );",
- [ 'Bar' ],
- ],
- [
- // Namespaced class is not currently supported. Must use namespace declaration
- // earlier in the file.
- "class_alias( Example\Foo::class, 'Bar' );",
- [],
- ],
- [
- "namespace Example;\nclass Foo {}\nclass_alias( Foo::class, 'Bar' );",
- [ 'Example\Foo', 'Bar' ],
- ],
- [
- "new class() extends Foo {}",
- []
- ]
- ];
- }
-
- /**
- * @dataProvider provideCases
- */
- public function testGetClasses( $code, array $classes, $message = null ) {
- $cc = new ClassCollector();
- $this->assertEquals( $classes, $cc->getClasses( "<?php\n$code" ), $message );
- }
-}