Files
Phraseanet/tests/Alchemy/Tests/Phrasea/Authentication/ContextTest.php
2013-05-29 14:23:23 +02:00

27 lines
721 B
PHP

<?php
namespace Alchemy\Tests\Phrasea\Authentication;
use Alchemy\Phrasea\Authentication\Context;
class ContextTest extends \PHPUnit_Framework_TestCase
{
public function testWithValidCOntext()
{
$contextValue = Context::CONTEXT_GUEST;
$context = new Context($contextValue);
$this->assertEquals($contextValue, $context->getContext());
$context->setContext(Context::CONTEXT_OAUTH2_NATIVE);
$this->assertEquals(Context::CONTEXT_OAUTH2_NATIVE, $context->getContext());
}
/**
* @expectedException Alchemy\Phrasea\Exception\InvalidArgumentException
*/
public function testWithInvalidCOntext()
{
new Context('No context like this');
}
}