Merge branch '3.6' of github.com:alchemy-fr/Phraseanet into 3.6

This commit is contained in:
Nicolas Le Goff
2012-01-25 19:02:26 +01:00
41 changed files with 610 additions and 723 deletions

View File

@@ -1154,7 +1154,6 @@ class ApiYamlApplication extends PhraseanetWebTestCaseAbstract
*
* @todo
*/
// var_dump($record["technical_informations"]);
$this->assertTrue(is_array($record["technical_informations"]));

View File

@@ -109,7 +109,6 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract
{
$appbox = appbox::get_instance();
$crawler = $this->client->request('POST', '/feeds/requestavailable/');
var_dump($this->client->getResponse()->getStatusCode());
$this->assertTrue($this->client->getResponse()->isOk());
$feeds = Feed_Collection::load_all($appbox, self::$user);
foreach ($feeds->get_feeds() as $one_feed)

View File

@@ -24,7 +24,8 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
*/
public static $entry;
public static $publisher;
public static $need_records = 1;
public static $need_records = 2;
public static $need_subdefs = true;
protected $client;
public function setUp()
@@ -35,6 +36,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
self::$publisher = Feed_Publisher_Adapter::getPublisher(appbox::get_instance(), self::$feed, self::$user);
self::$entry = Feed_Entry_Adapter::create(appbox::get_instance(), self::$feed, self::$publisher, 'title_entry', 'subtitle', 'hello', "test@mail.com");
Feed_Entry_Item::create(appbox::get_instance(), self::$entry, self::$record_1);
Feed_Entry_Item::create(appbox::get_instance(), self::$entry, self::$record_2);
self::$feed->set_public(true);
}
@@ -73,6 +75,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
$crawler = $this->client->request("GET", "/feeds/feed/" . $feed->get_id() . "/rss/");
$this->assertEquals("application/rss+xml", $this->client->getResponse()->headers->get("content-type"));
$xml = $this->client->getResponse()->getContent();
$this->verifyXML($xml);
$this->verifyRSS($feed, $xml);
@@ -141,6 +144,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
$crawler = $this->client->request("GET", "/feeds/feed/" . $feed->get_id() . "/rss/");
$this->assertTrue($this->client->getResponse()->isOk());
$xml = $this->client->getResponse()->getContent();
$this->verifyXML($xml);
$this->verifyRSS($feed, $xml);
$crawler = $this->client->request("GET", "/feeds/feed/" . $feed->get_id() . "/atom/");
@@ -161,7 +165,12 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
public function verifyXML($xml)
{
/**
* XML is not verified due to Validator Service bug
*/
return;
try
{
$validator = new W3CFeedRawValidator($xml);
@@ -177,8 +186,6 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
function verifyRSS(Feed_Adapter $feed, $xml_string)
{
$this->verifyXML($xml_string);
$dom_doc = new DOMDocument();
$dom_doc->loadXML($xml_string);
@@ -213,7 +220,6 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
break;
case 'pubDate':
$this->assertTrue(new DateTime() >= new DateTime($child->nodeValue));
break;
case 'generator':
$this->assertEquals("Phraseanet", $child->nodeValue);
@@ -314,8 +320,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
case 'media:content' :
$this->checkMediaContentAttributes($item, $node);
break;
case 'media:thumbnail' :
break;
case 'media:thumbnail':
default :
$this->checkOptionnalMediaGroupNode($node, $item);
break;
@@ -470,6 +475,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
)
);
foreach ($fields as $key_field => $field)
{
if ($field["media_field"]["name"] == $node->nodeName)
@@ -482,7 +488,8 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
{
foreach ($node->attributes as $attribute)
{
$this->assertTrue(array_key_exists($attribute->name, $field["media_field"]["attributes"]), "MIssing attribute " . $attribute->name . " for " . $field['media_field']['name']);
$this->assertTrue(array_key_exists($attribute->name, $field["media_field"]["attributes"]), "Checkin attribute ".$attribute->name." for " . $field['media_field']['name']);
$this->assertEquals($attribute->value, $field["media_field"]["attributes"][$attribute->name], "Checkin attribute ".$attribute->name." for " . $field['media_field']['name']);
}
}
}
@@ -640,4 +647,4 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
}
}
}
}

View File

@@ -17,13 +17,13 @@ require_once __DIR__ . '/../../../../../../PhraseanetPHPUnitAbstract.class.inc';
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class DoctrineNormalTest extends PhraseanetPHPUnitAbstract
class DoctrinePhpechoTest extends PhraseanetPHPUnitAbstract
{
public function testService()
{
$log = new \Alchemy\Phrasea\Core\Service\Log\Doctrine\Normal(
$log = new \Alchemy\Phrasea\Core\Service\Log\Doctrine\Phpecho(
'hello', array(), array()
);
@@ -32,7 +32,7 @@ class DoctrineNormalTest extends PhraseanetPHPUnitAbstract
public function testType()
{
$log = new \Alchemy\Phrasea\Core\Service\Log\Doctrine\Normal(
$log = new \Alchemy\Phrasea\Core\Service\Log\Doctrine\Phpecho(
'hello', array(), array()
);
@@ -41,7 +41,7 @@ class DoctrineNormalTest extends PhraseanetPHPUnitAbstract
public function testScope()
{
$log = new \Alchemy\Phrasea\Core\Service\Log\Doctrine\Normal(
$log = new \Alchemy\Phrasea\Core\Service\Log\Doctrine\Phpecho(
'hello', array(), array());
$this->assertEquals("log", $log->getScope());
}

View File

@@ -38,8 +38,7 @@ class Bridge_AccountSettingsTest extends PhraseanetPHPUnitAuthenticatedAbstract
}
catch (Exception $e)
{
var_dump($e->getMessage());
$this->fail();
$this->fail($e->getMessage());
}
}

View File

@@ -108,17 +108,6 @@ class EntityBasketTest extends PhraseanetPHPUnitAuthenticatedAbstract
$date = $this->basket->getUpdated();
$this->assertInstanceOf('\DateTime', $date);
// sleep(5);
// $this->basket->setName('hello COCOCOCO');
// $this->basket->setDescription('44WDFDFOLSDF');
// $this->em->persist($this->basket);
// $this->em->flush();
// var_dump($this->basket->getId());
// $basket = $this->em->getRepository('\Entities\Basket')->find($this->basket->getId());
// $dateUpdated = $basket->getUpdated();
// var_dump($date->format(DATE_ATOM), $dateUpdated->format(DATE_ATOM));
// $this->assertGreaterThan($dateUpdated, $date);
// $this->assertGreaterThan($dateUpdated, $this->basket->getCreated());
}
public function testGetElements()

View File

@@ -371,7 +371,7 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
}
}
self::$record_1->set_metadatas($metadatas);
self::$record_1->set_metadatas($metadatas, true);
$caption = self::$record_1->get_caption();
@@ -381,7 +381,7 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
{
$current_fields = $caption->get_fields(array($meta_el->get_name()));
$this->assertTrue(count($current_fields) == 1);
$this->assertEquals(1, count($current_fields));
$field = $current_fields[0];
$multi_imploded = implode(' ' . $meta_el->get_separator() . ' ', array('un', 'jeu', 'de', 'test'));