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'])); }
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(); }