mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
31 lines
772 B
PHP
31 lines
772 B
PHP
<?php
|
|
|
|
namespace Alchemy\Tests\Phrasea\Model\Converter;
|
|
|
|
use Alchemy\Phrasea\Model\Converter\TokenConverter;
|
|
|
|
/**
|
|
* @group functional
|
|
* @group legacy
|
|
*/
|
|
class TokenConverterTest extends \PhraseanetTestCase
|
|
{
|
|
public function testConvert()
|
|
{
|
|
$token = self::$DI['token_1'];
|
|
|
|
$converter = new TokenConverter(self::$DI['app']['repo.tokens']);
|
|
$this->assertSame($token, $converter->convert($token->getValue()));
|
|
}
|
|
|
|
/**
|
|
* @expectedException \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
|
|
* @expectedExceptionMessage Token is not valid.
|
|
*/
|
|
public function testConvertFailure()
|
|
{
|
|
$converter = new TokenConverter(self::$DI['app']['repo.tokens']);
|
|
$converter->convert('prout');
|
|
}
|
|
}
|