[TESTS] Add missing tests for Common
This commit is contained in:
parent
9ce30751af
commit
747b464c7d
|
@ -31,6 +31,8 @@ use Doctrine\ORM\Mapping\ClassMetadataFactory;
|
||||||
use Doctrine\ORM\Mapping\ClassMetadataInfo;
|
use Doctrine\ORM\Mapping\ClassMetadataInfo;
|
||||||
use Jchook\AssertThrows\AssertThrows;
|
use Jchook\AssertThrows\AssertThrows;
|
||||||
use Symfony\Component\DependencyInjection\ParameterBag\ContainerBagInterface;
|
use Symfony\Component\DependencyInjection\ParameterBag\ContainerBagInterface;
|
||||||
|
use Symfony\Component\HttpFoundation\ParameterBag;
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\Security\Core\Security as SSecurity;
|
use Symfony\Component\Security\Core\Security as SSecurity;
|
||||||
|
|
||||||
class CommonTest extends GNUsocialTestCase
|
class CommonTest extends GNUsocialTestCase
|
||||||
|
@ -63,6 +65,16 @@ class CommonTest extends GNUsocialTestCase
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSetRequestAndRoute()
|
||||||
|
{
|
||||||
|
$req = $this->createMock(Request::class);
|
||||||
|
$req->attributes = $this->createMock(ParameterBag::class);
|
||||||
|
$req->attributes->method('get')->willReturn('test_route');
|
||||||
|
Common::setRequest($req);
|
||||||
|
static::assertSame('test_route', Common::route());
|
||||||
|
static::assertTrue(Common::isRoute('test_route'));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test Common::user, Common::actor and such. Requires a lot of setup
|
* Test Common::user, Common::actor and such. Requires a lot of setup
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user