Пример #1
0
 /**
  * @param \PHPUnit_Framework_TestCase $phpUnitTestCase
  * @return array
  */
 private function getColumns(\PHPUnit_Framework_TestCase $phpUnitTestCase)
 {
     $factory = new TestCaseFactory();
     $testCase = $factory->createTestCase($phpUnitTestCase);
     $columns = array(Columns::CLASS_NAME => $testCase->getClassName(), Columns::METHOD_NAME => $testCase->getMethod(), Columns::DATA_NAME => $testCase->getDataName(), Columns::DATA => $testCase->getData());
     ksort($columns);
     return $columns;
 }
 /**
  * @param array $methodsToFilter
  * @param \PHPUnit_Framework_MockObject_Matcher_Invocation $invocation
  * @param bool $isValid
  * @return \PHPUnit_Framework_MockObject_MockObject|ReaderInterface
  */
 private function getReader($methodsToFilter, \PHPUnit_Framework_MockObject_Matcher_Invocation $invocation, $isValid = true)
 {
     $testCaseFactory = new TestCaseFactory();
     $testCasesToFilter = array();
     foreach ($methodsToFilter as $testName) {
         $testCasesToFilter[] = $testCaseFactory->createTestCase(new FilterTestMock($testName));
     }
     $reader = $this->getMock('Nikoms\\FailLover\\TestCaseResult\\Storage\\ReaderInterface', array('getList', 'isEmpty', 'isValid'));
     $reader->expects($invocation)->method('getList')->will($this->returnValue($testCasesToFilter));
     $reader->expects($invocation)->method('isEmpty')->will($this->returnValue(empty($testCasesToFilter)));
     $reader->expects($invocation)->method('isValid')->will($this->returnValue($isValid));
     return $reader;
 }
 public function testCreateTestCase_WhenTheTestDoesNotHaveDataName_DataNameIsNull()
 {
     $factory = new TestCaseFactory();
     $testCase = $factory->createTestCase(new FilterTestMock('testSimple'));
     $this->assertNull($testCase->getDataName());
 }