public function testServiceLocateApp()
{
$testApp = Libraries::get(true, 'resources') . '/tmp/tests/test_app';
mkdir($testApp, 0777, true);
Libraries::add('test_app', array('path' => $testApp));
mkdir($testApp . '/controllers', 0777, true);
$body = <<<EOD
<?php
namespace test_app\\controllers;
class HelloWorldCustomTestController extends \\lithium\\action\\Controller {
\tpublic function index() {}
}
?>
EOD;
$filepath = $testApp . '/controllers/HelloWorldCustomTestController.php';
file_put_contents($filepath, $body);
Libraries::cache(false);
$result = Libraries::locate('controllers', 'HelloWorldCustomTest');
$expected = 'test_app\\controllers\\HelloWorldCustomTestController';
$this->assertEqual($expected, $result);
$result = Libraries::locate('controllers', 'HelloWorldCustomTest');
$this->assertEqual($expected, $result);
}