class ExportCommandTest extends WallabagCoreTestCase
{
/**
- * @expectedException Symfony\Component\Console\Exception\RuntimeException
+ * @expectedException \Symfony\Component\Console\Exception\RuntimeException
* @expectedExceptionMessage Not enough arguments (missing: "username")
*/
public function testExportCommandWithoutUsername()
class TagAllCommandTest extends WallabagCoreTestCase
{
/**
- * @expectedException Symfony\Component\Console\Exception\RuntimeException
+ * @expectedException \Symfony\Component\Console\Exception\RuntimeException
* @expectedExceptionMessage Not enough arguments (missing: "username")
*/
public function testRunTagAllCommandWithoutUsername()
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Entity\Tag;
use Wallabag\UserBundle\Entity\User;
-use Wallabag\CoreBundle\Repository\TagRepository;
use Wallabag\CoreBundle\Helper\RuleBasedTagger;
class ContentProxyTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\HttpKernel\Exception\NotFoundHttpException
+ * @expectedException \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
* @expectedExceptionMessage User not found
*/
public function testApplyUserNotFound()
class RedisWorkerCommandTest extends WallabagCoreTestCase
{
/**
- * @expectedException Symfony\Component\Console\Exception\RuntimeException
+ * @expectedException \Symfony\Component\Console\Exception\RuntimeException
* @expectedExceptionMessage Not enough arguments (missing: "serviceName")
*/
public function testRunRedisWorkerCommandWithoutArguments()
}
/**
- * @expectedException Symfony\Component\Config\Definition\Exception\Exception
+ * @expectedException \Symfony\Component\Config\Definition\Exception\Exception
* @expectedExceptionMessage No queue or consumer found for service name
*/
public function testRunRedisWorkerCommandWithBadService()
$this->assertNotEmpty($content->getMimetype(), 'Mimetype for https://ma.ttias.be is ok');
$this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for https://ma.ttias.be is ok');
$this->assertNotEmpty($content->getLanguage(), 'Language for https://ma.ttias.be is ok');
- $this->assertEquals(3, count($content->getTags()));
+
+ $tags = $content->getTags();
+ $this->assertContains('foot', $tags, 'It includes the "foot" tag');
+ $this->assertContains('varnish', $tags, 'It includes the "varnish" tag');
+ $this->assertContains('PHP', $tags, 'It includes the "PHP" tag');
+ $this->assertEquals(3, count($tags));
+
$this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());
$this->assertEquals('2016-10-26', $content->getCreatedAt()->format('Y-m-d'));
}
$this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.zataz.com is ok');
$this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.zataz.com is ok');
$this->assertNotEmpty($content->getLanguage(), 'Language for http://www.zataz.com is ok');
- $this->assertEquals(1, count($content->getTags()));
+
+ $tags = $content->getTags();
+ $this->assertContains('foot', $tags, 'It includes the "foot" tag');
+ $this->assertEquals(1, count($tags));
+
$this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());
$this->assertEquals('2016-09-08', $content->getCreatedAt()->format('Y-m-d'));
}
$this->getLoggedInUserId()
);
- $tag = $client->getContainer()
- ->get('doctrine.orm.entity_manager')
- ->getRepository('WallabagCoreBundle:Tag')
- ->findOneByLabel('Framabag');
-
- $this->assertTrue($content->getTags()->contains($tag));
-
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
$this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.framablog.org is ok');
$this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.framablog.org is ok');
$this->assertNotEmpty($content->getLanguage(), 'Language for http://www.framablog.org is ok');
- $this->assertEquals(2, count($content->getTags()));
+
+ $tags = $content->getTags();
+ $this->assertContains('foot', $tags, 'It includes the "foot" tag');
+ $this->assertContains('Framabag', $tags, 'It includes the "Framabag" tag');
+ $this->assertEquals(2, count($tags));
+
$this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());
}
$this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.liberation.fr is ok');
$this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.liberation.fr is ok');
$this->assertNotEmpty($content->getLanguage(), 'Language for http://www.liberation.fr is ok');
- $this->assertEquals(1, count($content->getTags()));
+
+ $tags = $content->getTags();
+ $this->assertContains('foot', $tags, 'It includes the "foot" tag');
+ $this->assertEquals(1, count($tags));
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
$this->assertNotEmpty($content->getMimetype(), 'Mimetype for https://www.mediapart.fr is ok');
$this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for https://www.mediapart.fr is ok');
$this->assertNotEmpty($content->getLanguage(), 'Language for https://www.mediapart.fr is ok');
- $this->assertEquals(3, count($content->getTags()));
+
+ $tags = $content->getTags();
+ $this->assertContains('foot', $tags, 'It includes the "foot" tag');
+ $this->assertContains('mediapart', $tags, 'It includes the "mediapart" tag');
+ $this->assertContains('blog', $tags, 'It includes the "blog" tag');
+ $this->assertEquals(3, count($tags));
+
$this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());
$this->assertEquals('2016-09-08', $content->getCreatedAt()->format('Y-m-d'));
$this->assertTrue($content->isStarred(), 'Entry is starred');