PHPUnit_Framework_TestSuite::testAt PHP Method

testAt() public method

Returns the test at the given index.
public testAt ( $index ) : PHPUnit_Framework_Test
return PHPUnit_Framework_Test
    public function testAt($index)
    {
        if (isset($this->tests[$index])) {
            return $this->tests[$index];
        } else {
            return false;
        }
    }

Usage Example

Example #1
0
 public function testEndTestSuiteDestruct()
 {
     $clearProperties = new Magento_Test_ClearProperties();
     $phpUnitTestSuite = new PHPUnit_Framework_TestSuite();
     $phpUnitTestSuite->addTestFile(__DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'DummyTestCase.php');
     // Because addTestFile() adds classes from file to tests array, use first testsuite
     /** @var $testSuite PHPUnit_Framework_TestSuite */
     $testSuite = $phpUnitTestSuite->testAt(0);
     $testSuite->run();
     $testClass = $testSuite->testAt(0);
     foreach ($this->_properties as $property) {
         if ($property['is_static']) {
             $this->assertAttributeEquals($property['expectedValue'], $property['name'], get_class($testClass));
         } else {
             $this->assertAttributeEquals($property['expectedValue'], $property['name'], $testClass);
         }
     }
     $clearProperties->endTestSuite($testSuite);
     $this->assertTrue(Magento_Test_ClearProperties_Stub::$isDestructCalled);
     foreach ($this->_properties as $property) {
         if ($property['is_static']) {
             $this->assertAttributeEmpty($property['name'], get_class($testClass));
         } else {
             $this->assertAttributeEmpty($property['name'], $testClass);
         }
     }
 }
All Usage Examples Of PHPUnit_Framework_TestSuite::testAt