See also: lithium\test
Inheritance: extends lithium\console\Command
Exemplo n.º 1
0
 public function testJsonFormat()
 {
     $command = new Test(array('request' => $this->request, 'classes' => $this->classes));
     $path = LITHIUM_LIBRARY_PATH . '/lithium/tests/mocks/test/cases/MockTest.php';
     $command->format = 'json';
     $command->run($path);
     $result = $command->response->output;
     $result = json_decode($result, true);
     $this->assertTrue(isset($result['count']));
     $this->assertTrue(isset($result['stats']));
 }
Exemplo n.º 2
0
 public function testPathWithCustomDirectoryName()
 {
     $testApp = Libraries::get(true, 'resources') . '/tmp/tests/custom_dir';
     $testDir = $testApp . '/tests/cases/models';
     mkdir($testDir, 0777, true);
     Libraries::add('test_app', array('path' => $testApp));
     $request = new Request(array('env' => array('working' => $testApp)));
     $command = new Test(array('request' => $request, 'classes' => $this->classes));
     $expected = 'test_app\\tests\\cases\\models';
     $result = $command->invokeMethod('_path', array('tests\\cases\\models'));
     $this->assertIdentical($expected, $result);
     Libraries::remove('test_app');
     $this->_cleanUp();
 }