Exemplo n.º 1
0
 /**
  * @test
  */
 public function getCollectedOutputAfterTwoOutputCallReturnsOutputsInCallingOrder()
 {
     $output1 = 'Hello world ...';
     $this->subject->output($output1);
     $output2 = ' and hello again.';
     $this->subject->output($output2);
     self::assertSame($output1 . $output2, $this->subject->getCollectedOutput());
 }
 /**
  * @test
  */
 public function renderNotSelectsAnyOptionWithInvalidSelectedExtension()
 {
     $this->userSettingsService->set(Tx_Phpunit_Interface_Request::PARAMETER_KEY_TESTABLE, 'foo');
     $this->subject->injectUserSettingService($this->userSettingsService);
     $this->subject->render();
     self::assertNotContains(' selected="selected"', $this->outputService->getCollectedOutput());
 }
 /**
  * @test
  */
 public function startTestSuiteOutputsPrettifiedTestClassNameHtmlSpecialchared()
 {
     $testSuiteName = '<b>b</b>';
     /** @var $fixture Tx_Phpunit_BackEnd_TestListener|PHPUnit_Framework_MockObject_MockObject  */
     $fixture = $this->getMock('Tx_Phpunit_BackEnd_TestListener', array('prettifyTestClass'));
     $fixture->injectOutputService($this->outputService);
     /** @var $testSuite PHPUnit_Framework_TestSuite|PHPUnit_Framework_MockObject_MockObject */
     $testSuite = $this->getMock('PHPUnit_Framework_TestSuite', array('run'), array($testSuiteName));
     $fixture->expects($this->once())->method('prettifyTestClass')->with($testSuiteName)->will($this->returnValue($testSuiteName));
     $fixture->startTestSuite($testSuite);
     $this->assertContains(htmlspecialchars($testSuiteName), $this->outputService->getCollectedOutput());
     $this->assertNotContains($testSuiteName, $this->outputService->getCollectedOutput());
 }
Exemplo n.º 4
0
 /**
  * @test
  */
 public function renderRunTestsIntroForSelectedExtensionRendersCheckboxes()
 {
     $selectedExtension = 'phpunit';
     /** @var $subject Tx_Phpunit_BackEnd_Module|PHPUnit_Framework_MockObject_MockObject */
     $subject = $this->getMock($this->createAccessibleProxy(), array('createExtensionSelector', 'createTestCaseSelector', 'createCheckboxes', 'createTestSelector'));
     $subject->injectRequest($this->request);
     $subject->injectOutputService($this->outputService);
     $subject->injectTestFinder($this->testFinder);
     $this->userSettingsService->set('extSel', $selectedExtension);
     $subject->injectUserSettingsService($this->userSettingsService);
     $subject->expects(self::once())->method('createTestSelector')->with($selectedExtension)->will(self::returnValue('test selector'));
     $subject->renderRunTestsIntro();
     self::assertContains('test selector', $this->outputService->getCollectedOutput());
 }
 /**
  * @test
  */
 public function renderCreatesProgressBarHtmlId()
 {
     $this->subject->render();
     self::assertContains('id="progress-bar"', $this->outputService->getCollectedOutput());
 }