Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 3.148.167.99
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
3 /
phpunit /
phpunit /
tests /
unit /
Framework /
Delete
Unzip
Name
Size
Permission
Date
Action
Constraint
[ DIR ]
drwxr-xr-x
2018-12-03 09:00
MockObject
[ DIR ]
drwxr-xr-x
2018-12-03 09:00
AssertTest.php
82.56
KB
-rw-r--r--
2018-12-03 09:00
ConstraintTest.php
38.24
KB
-rw-r--r--
2018-12-03 09:00
ExceptionWrapperTest.php
1.58
KB
-rw-r--r--
2018-12-03 09:00
TestCaseTest.php
23
KB
-rw-r--r--
2018-12-03 09:00
TestFailureTest.php
4.4
KB
-rw-r--r--
2018-12-03 09:00
TestImplementorTest.php
643
B
-rw-r--r--
2018-12-03 09:00
TestListenerTest.php
2.64
KB
-rw-r--r--
2018-12-03 09:00
TestResultTest.php
3.08
KB
-rw-r--r--
2018-12-03 09:00
TestSuiteTest.php
6.49
KB
-rw-r--r--
2018-12-03 09:00
Save
Rename
<?php /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Framework; class TestSuiteTest extends TestCase { /** * @var TestResult */ private $result; protected function setUp(): void { $this->result = new TestResult; } protected function tearDown(): void { $this->result = null; } public function testAddTestSuite(): void { $suite = new TestSuite(\OneTestCase::class); $suite->run($this->result); $this->assertCount(1, $this->result); } public function testInheritedTests(): void { $suite = new TestSuite(\InheritedTestCase::class); $suite->run($this->result); $this->assertTrue($this->result->wasSuccessful()); $this->assertCount(2, $this->result); } public function testNoTestCases(): void { $suite = new TestSuite(\NoTestCases::class); $suite->run($this->result); $this->assertNotTrue($this->result->wasSuccessful()); $this->assertEquals(0, $this->result->failureCount()); $this->assertEquals(1, $this->result->warningCount()); $this->assertCount(1, $this->result); } public function testNoTestCaseClass(): void { $this->expectException(Exception::class); new TestSuite(\NoTestCaseClass::class); } public function testNotPublicTestCase(): void { $suite = new TestSuite(\NotPublicTestCase::class); $this->assertCount(2, $suite); } public function testNotVoidTestCase(): void { $suite = new TestSuite(\NotVoidTestCase::class); $this->assertCount(1, $suite); } public function testOneTestCase(): void { $suite = new TestSuite(\OneTestCase::class); $suite->run($this->result); $this->assertEquals(0, $this->result->errorCount()); $this->assertEquals(0, $this->result->failureCount()); $this->assertCount(1, $this->result); $this->assertTrue($this->result->wasSuccessful()); } public function testShadowedTests(): void { $suite = new TestSuite(\OverrideTestCase::class); $suite->run($this->result); $this->assertCount(1, $this->result); } public function testBeforeClassAndAfterClassAnnotations(): void { $suite = new TestSuite(\BeforeClassAndAfterClassTest::class); \BeforeClassAndAfterClassTest::resetProperties(); $suite->run($this->result); $this->assertEquals(1, \BeforeClassAndAfterClassTest::$beforeClassWasRun, '@beforeClass method was not run once for the whole suite.'); $this->assertEquals(1, \BeforeClassAndAfterClassTest::$afterClassWasRun, '@afterClass method was not run once for the whole suite.'); } public function testBeforeClassWithDataProviders(): void { $suite = new TestSuite(\BeforeClassWithOnlyDataProviderTest::class); \BeforeClassWithOnlyDataProviderTest::resetProperties(); $suite->run($this->result); $this->assertTrue(\BeforeClassWithOnlyDataProviderTest::$setUpBeforeClassWasCalled, 'setUpBeforeClass method was not run.'); $this->assertTrue(\BeforeClassWithOnlyDataProviderTest::$beforeClassWasCalled, '@beforeClass method was not run.'); } public function testBeforeAnnotation(): void { $test = new TestSuite(\BeforeAndAfterTest::class); \BeforeAndAfterTest::resetProperties(); $test->run(); $this->assertEquals(2, \BeforeAndAfterTest::$beforeWasRun); $this->assertEquals(2, \BeforeAndAfterTest::$afterWasRun); } public function testTestWithAnnotation(): void { $test = new TestSuite(\TestWithTest::class); \BeforeAndAfterTest::resetProperties(); $result = $test->run(); $this->assertCount(4, $result->passed()); } public function testSkippedTestDataProvider(): void { $suite = new TestSuite(\DataProviderSkippedTest::class); $suite->run($this->result); $this->assertEquals(3, $this->result->count()); $this->assertEquals(1, $this->result->skippedCount()); } public function testTestDataProviderDependency(): void { $suite = new TestSuite(\DataProviderDependencyTest::class); $suite->run($this->result); $skipped = $this->result->skipped(); $lastSkippedResult = \array_pop($skipped); $message = $lastSkippedResult->thrownException()->getMessage(); $this->assertContains('Test for DataProviderDependencyTest::testDependency skipped by data provider', $message); } public function testIncompleteTestDataProvider(): void { $suite = new TestSuite(\DataProviderIncompleteTest::class); $suite->run($this->result); $this->assertEquals(3, $this->result->count()); $this->assertEquals(1, $this->result->notImplementedCount()); } public function testRequirementsBeforeClassHook(): void { $suite = new TestSuite(\RequirementsClassBeforeClassHookTest::class); $suite->run($this->result); $this->assertEquals(0, $this->result->errorCount()); $this->assertEquals(1, $this->result->skippedCount()); } public function testDoNotSkipInheritedClass(): void { $suite = new TestSuite( 'DontSkipInheritedClass' ); $dir = TEST_FILES_PATH . \DIRECTORY_SEPARATOR . 'Inheritance' . \DIRECTORY_SEPARATOR; $suite->addTestFile($dir . 'InheritanceA.php'); $suite->addTestFile($dir . 'InheritanceB.php'); $result = $suite->run(); $this->assertCount(2, $result); } /** * @expectedException PHPUnit\Framework\Exception * @expectedExceptionMessage No valid test provided. */ public function testCreateTestForConstructorlessTestClass(): void { $reflection = $this->getMockBuilder(\ReflectionClass::class) ->setConstructorArgs([$this]) ->getMock(); $reflection->expects($this->once()) ->method('getConstructor') ->willReturn(null); $reflection->expects($this->once()) ->method('isInstantiable') ->willReturn(true); $reflection->expects($this->once()) ->method('getName') ->willReturn(__CLASS__); TestSuite::createTest($reflection, 'TestForConstructorlessTestClass'); } }