Exemplo n.º 1
0
 /**
  * Setup the object
  *
  * @param  string $sCommand
  *
  * @return void
  */
 protected function _setup($sCommand = '')
 {
     $sCommand = empty($sCommand) === true ? 'cd /tmp; echo ' . \Testy\Project\Test\Runner::FILE_PLACEHOLDER . ' > /dev/null' : $sCommand;
     $this->_oConfig = new \stdClass();
     $this->_oConfig->test = $sCommand;
     $this->_oConfig->path = '/tmp';
     $this->_oConfig->find = '*';
     $this->_oProject = new \Testy\Project(self::PROJECT_NAME);
     $this->assertInstanceOf('\\Testy\\Project', $this->_oProject->config($this->_oConfig));
     $this->assertInstanceOf('\\Testy\\Project', $this->_oProject->setCommand(\Testy\Test\Helper\Command::getSuccess()));
     $this->_object = new \Testy\Project\Test\Runner($this->_oProject, array(__FILE__), $this->_oConfig);
 }
Exemplo n.º 2
0
 /**
  * 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);
 }