/** * Test the lint-command * * @dataProvider lintProvider */ public function testLint($bExpected, $sCommand = 'Success') { $this->_oConfig->syntax = 'test'; $this->assertInstanceOf('\\Testy\\Project', $this->_object->config($this->_oConfig)); $this->assertTrue($this->_object->shouldSyntaxCheck()); $sCommand = 'get' . ucfirst($sCommand); $this->assertInstanceOf('\\Testy\\Project', $this->_object->setCommand(\Testy\Test\Helper\Command::$sCommand())); $oRunner = new \Testy\Project\Test\Runner($this->_object, array(__FILE__), $this->_oConfig); $this->assertEquals($bExpected, $this->_object->lint($oRunner)); unset($oRunner, $sCommand); }
/** * Test the result, if a command does not succeed */ public function testCommandFailure() { $aFiles = array(__FILE__); try { $this->assertInstanceOf('\\Testy\\Project', $this->_oProject->setCommand(\Testy\Test\Helper\Command::getFailure())); $oRunner = new \Testy\Project\Test\Runner($this->_oProject, $aFiles, $this->_oConfig); $oRunner->setCommand('./' . uniqid())->run(); $this->fail('An exception should have been thrown'); } catch (\Testy\Project\Test\Exception $e) { $this->assertEquals('', $e->getMessage()); } }