diff --git a/templates/web/prod/actions/Bridge/Dailymotion/upload.twig b/templates/web/prod/actions/Bridge/Dailymotion/upload.twig index 13e1ce0417..15843c2ac8 100644 --- a/templates/web/prod/actions/Bridge/Dailymotion/upload.twig +++ b/templates/web/prod/actions/Bridge/Dailymotion/upload.twig @@ -34,7 +34,7 @@ - +
{{ error_form.display_errors(name, constraint_errors) }} @@ -48,7 +48,7 @@ - +
{{ error_form.display_errors(name, constraint_errors) }} diff --git a/templates/web/prod/actions/Bridge/Flickr/upload.twig b/templates/web/prod/actions/Bridge/Flickr/upload.twig index 43735997ab..5dc1db2f46 100644 --- a/templates/web/prod/actions/Bridge/Flickr/upload.twig +++ b/templates/web/prod/actions/Bridge/Flickr/upload.twig @@ -45,7 +45,7 @@ - +
{{ error_form.display_errors(name, constraint_errors) }} @@ -61,7 +61,7 @@ - +
{{ error_form.display_errors(name, constraint_errors) }} diff --git a/templates/web/prod/actions/Bridge/Youtube/upload.twig b/templates/web/prod/actions/Bridge/Youtube/upload.twig index be620d6882..de4a361b44 100644 --- a/templates/web/prod/actions/Bridge/Youtube/upload.twig +++ b/templates/web/prod/actions/Bridge/Youtube/upload.twig @@ -34,7 +34,7 @@ - +
{{ error_form.display_errors(name, constraint_errors) }} @@ -49,7 +49,7 @@ - +
{{ error_form.display_errors(name, constraint_errors) }} diff --git a/tests/Alchemy/Phrasea/Controller/Prod/FeedTest.php b/tests/Alchemy/Phrasea/Controller/Prod/FeedTest.php index 3118e13593..03627c39e0 100644 --- a/tests/Alchemy/Phrasea/Controller/Prod/FeedTest.php +++ b/tests/Alchemy/Phrasea/Controller/Prod/FeedTest.php @@ -195,11 +195,13 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract ); - $crawler = $this->client->request('GET', '/feeds/entry/' . $entry->get_id() . '/edit/'); - - $response = $this->client->getResponse(); - - $this->assertFalse($response->isOk()); + try + { + $crawler = $this->client->request('GET', '/feeds/entry/' . $entry->get_id() . '/edit/'); + $this->fail('Should raise an exception'); + } catch(Exception_UnauthorizedAction $e) { + + } $feed->delete(); } diff --git a/tests/Alchemy/Phrasea/Controller/Prod/TooltipTest.php b/tests/Alchemy/Phrasea/Controller/Prod/TooltipTest.php index e5a21dc077..dd033e18d2 100644 --- a/tests/Alchemy/Phrasea/Controller/Prod/TooltipTest.php +++ b/tests/Alchemy/Phrasea/Controller/Prod/TooltipTest.php @@ -36,11 +36,24 @@ class ControllerTooltipTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $crawler = $this->client->request('POST', '/tooltip/basket/' . $basket->getId() . '/'); $pageContent = $this->client->getResponse()->getContent(); $this->assertTrue($this->client->getResponse()->isOk()); - - $crawler = $this->client->request('POST', '/tootltip/basket/notanid/'); + } + + /** + * @expectedException \Symfony\Component\HttpKernel\Exception\NotFoundHttpException + */ + public function testRouteBasketFail() + { + $crawler = $this->client->request('POST', '/tooltip/basket/notanid/'); $pageContent = $this->client->getResponse()->getContent(); $this->assertFalse($this->client->getResponse()->isOk()); + } + + /** + * @expectedException \Symfony\Component\HttpKernel\Exception\NotFoundHttpException + */ + public function testRouteBasketFail2() + { $crawler = $this->client->request('POST', '/tooltip/basket/-5/'); $pageContent = $this->client->getResponse()->getContent(); $this->assertFalse($this->client->getResponse()->isOk()); diff --git a/tests/Alchemy/Phrasea/Controller/Root/RSSFeedTest.php b/tests/Alchemy/Phrasea/Controller/Root/RSSFeedTest.php index 93908252f6..a06ba020c0 100644 --- a/tests/Alchemy/Phrasea/Controller/Root/RSSFeedTest.php +++ b/tests/Alchemy/Phrasea/Controller/Root/RSSFeedTest.php @@ -340,14 +340,20 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract $this->verifyXML($xml); } + /** + * @expectedException \Exception_FeedNotFound + */ public function testUnknowFeedId() { - $crawler = $this->client->request("GET", "/feeds/feed/0/"); - $this->assertFalse($this->client->getResponse()->isOk()); - $this->assertEquals(404, $this->client->getResponse()->getStatusCode()); - $crawler = $this->client->request("GET", "/feeds/feed/titi/"); - $this->assertFalse($this->client->getResponse()->isOk()); - $this->assertEquals(404, $this->client->getResponse()->getStatusCode()); + $this->client->request("GET", "/feeds/feed/0/rss/"); + } + + /** + * @expectedException \Symfony\Component\HttpKernel\Exception\NotFoundHttpException + */ + public function testUnknowFeedId2() + { + $this->client->request("GET", "/feeds/feed/titi/"); } public function testGetFeedId() @@ -634,7 +640,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract 'media_field' => array( 'name' => 'media:credit', 'attributes' => array( - 'role' => 'creator', + 'role' => 'director', 'scheme' => 'urn:ebu' ) ), @@ -671,10 +677,23 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract foreach ($fields as $key_field => $field) { - if ($field["media_field"]["name"] == $node->nodeName) { + + $role = true; + + if(isset($field["media_field"]['attributes']['role'])){ + $role = false; + foreach($node->attributes as $attr){ + if($attr->name == 'role') { + $role = $attr->value == $field["media_field"]['attributes']['role']; + break; + } + } + } + + if ($field["media_field"]["name"] == $node->nodeName && $role != false) { + if ($p4field = $entry_item->get_record()->get_caption()->get_dc_field($field["dc_field"])) { - $this->assertEquals($p4field->get_serialized_values($field["separator"]), $node->nodeValue - , sprintf('Asserting good value for DC %s', $field["dc_field"])); + $this->assertEquals($p4field->get_serialized_values($field["separator"]), $node->nodeValue, sprintf('Asserting good value for DC %s', $field["dc_field"])); if (sizeof($field["media_field"]["attributes"]) > 0) { foreach ($node->attributes as $attribute) { $this->assertTrue(array_key_exists($attribute->name, $field["media_field"]["attributes"]), "Checkin attribute " . $attribute->name . " for " . $field['media_field']['name']);