namespace Wallabag\CoreBundle\Tests\Command;
-use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Wallabag\CoreBundle\ParamConverter\UsernameRssTokenConverter;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Component\HttpFoundation\Request;
-use Wallabag\CoreBundle\Entity\User;
+use Wallabag\UserBundle\Entity\User;
-class UsernameRssTokenConverterTest extends KernelTestCase
+class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase
{
public function testSupportsWithNoRegistry()
{
$meta->expects($this->once())
->method('getName')
- ->will($this->returnValue('Wallabag\CoreBundle\Entity\User'));
+ ->will($this->returnValue('Wallabag\UserBundle\Entity\User'));
$em = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectManager')
->disableOriginalConstructor()
$em->expects($this->once())
->method('getClassMetadata')
- ->with('WallabagCoreBundle:User')
+ ->with('WallabagUserBundle:User')
->will($this->returnValue($meta));
$registry = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry')
$registry->expects($this->once())
->method('getManagerForClass')
- ->with('WallabagCoreBundle:User')
+ ->with('WallabagUserBundle:User')
->will($this->returnValue($em));
- $params = new ParamConverter(array('class' => 'WallabagCoreBundle:User'));
+ $params = new ParamConverter(array('class' => 'WallabagUserBundle:User'));
$converter = new UsernameRssTokenConverter($registry);
$this->assertTrue($converter->supports($params));
*/
public function testApplyUserNotFound()
{
- $repo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\UserRepository')
+ $repo = $this->getMockBuilder('Wallabag\UserBundle\Repository\UserRepository')
->disableOriginalConstructor()
->getMock();
$em->expects($this->once())
->method('getRepository')
- ->with('WallabagCoreBundle:User')
+ ->with('WallabagUserBundle:User')
->will($this->returnValue($repo));
$registry = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry')
$registry->expects($this->once())
->method('getManagerForClass')
- ->with('WallabagCoreBundle:User')
+ ->with('WallabagUserBundle:User')
->will($this->returnValue($em));
- $params = new ParamConverter(array('class' => 'WallabagCoreBundle:User'));
+ $params = new ParamConverter(array('class' => 'WallabagUserBundle:User'));
$converter = new UsernameRssTokenConverter($registry);
$request = new Request(array(), array(), array('username' => 'test', 'token' => 'test'));
{
$user = new User();
- $repo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\UserRepository')
+ $repo = $this->getMockBuilder('Wallabag\UserBundle\Repository\UserRepository')
->disableOriginalConstructor()
->getMock();
$em->expects($this->once())
->method('getRepository')
- ->with('WallabagCoreBundle:User')
+ ->with('WallabagUserBundle:User')
->will($this->returnValue($repo));
$registry = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry')
$registry->expects($this->once())
->method('getManagerForClass')
- ->with('WallabagCoreBundle:User')
+ ->with('WallabagUserBundle:User')
->will($this->returnValue($em));
- $params = new ParamConverter(array('class' => 'WallabagCoreBundle:User', 'name' => 'user'));
+ $params = new ParamConverter(array('class' => 'WallabagUserBundle:User', 'name' => 'user'));
$converter = new UsernameRssTokenConverter($registry);
$request = new Request(array(), array(), array('username' => 'test', 'token' => 'test'));