Use composer as application autoloader

This commit is contained in:
Romain Neutron
2013-01-18 17:47:25 +01:00
parent 358cdddcc6
commit 2069d40544
784 changed files with 1031 additions and 1806 deletions

View File

@@ -0,0 +1,37 @@
<?php
namespace Alchemy\Tests\Phrasea\Controller\Utils;
class ControllerPathFileTestTest extends \PhraseanetWebTestCaseAbstract
{
/**
* Default route test
*/
public function testRoutePath()
{
$file = new \SplFileObject(__DIR__ . '/../../../../../files/cestlafete.jpg');
self::$DI['client']->request("GET", "/admin/tests/pathurl/path/", array('path' => $file->getPathname()));
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
$this->assertEquals("application/json", self::$DI['client']->getResponse()->headers->get("content-type"));
$content = json_decode(self::$DI['client']->getResponse()->getContent());
$this->assertTrue(is_object($content));
$this->assertObjectHasAttribute('exists', $content);
$this->assertObjectHasAttribute('file', $content);
$this->assertObjectHasAttribute('dir', $content);
$this->assertObjectHasAttribute('readable', $content);
$this->assertObjectHasAttribute('executable', $content);
}
public function testRouteUrl()
{
self::$DI['client']->request("GET", "/admin/tests/pathurl/url/", array('url' => "www.google.com"));
$response = self::$DI['client']->getResponse();
$this->assertTrue($response->isOk());
$this->assertEquals("application/json", self::$DI['client']->getResponse()->headers->get("content-type"));
$content = json_decode(self::$DI['client']->getResponse()->getContent());
$this->assertTrue(is_object($content));
}
}