mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
31 lines
878 B
PHP
31 lines
878 B
PHP
<?php
|
|
|
|
namespace Alchemy\Tests\Phrasea\Model\Converter;
|
|
|
|
use Alchemy\Phrasea\Model\Converter\BasketConverter;
|
|
|
|
/**
|
|
* @group functional
|
|
* @group legacy
|
|
*/
|
|
class BasketConverterTest extends \PhraseanetTestCase
|
|
{
|
|
public function testConvert()
|
|
{
|
|
$basket = self::$DI['app']['orm.em']->find('Phraseanet:Basket', 1);
|
|
|
|
$converter = new BasketConverter(self::$DI['app']['orm.em']->getRepository('Phraseanet:Basket'));
|
|
$this->assertSame($basket, $converter->convert($basket->getId()));
|
|
}
|
|
|
|
/**
|
|
* @expectedException \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
|
|
* @expectedExceptionMessage Basket prout not found.
|
|
*/
|
|
public function testConvertFailure()
|
|
{
|
|
$converter = new BasketConverter(self::$DI['app']['orm.em']->getRepository('Phraseanet:Basket'));
|
|
$converter->convert('prout');
|
|
}
|
|
}
|