$this->assertSame($this->url, $content->getUrl());
$this->assertContains('Google', $content->getTitle());
$this->assertSame('fr', $content->getLanguage());
$this->assertSame($this->url, $content->getUrl());
$this->assertContains('Google', $content->getTitle());
$this->assertSame('fr', $content->getLanguage());
- $this->assertSame('2015-03-28 11:43:19', $content->getPublishedAt()->format('Y-m-d H:i:s'));
- $this->assertSame('Morgane Tual', $author[0]);
- $this->assertArrayHasKey('x-varnish1', $content->getHeaders());
+ $this->assertSame('2016-04-07 19:01:35', $content->getPublishedAt()->format('Y-m-d H:i:s'));
+ $this->assertArrayHasKey('x-frame-options', $content->getHeaders());
$client->getContainer()->get('craue_config')->set('store_article_headers', 0);
}
public function testPostWithMultipleAuthors()
{
$client->getContainer()->get('craue_config')->set('store_article_headers', 0);
}
public function testPostWithMultipleAuthors()
{
->getRepository('WallabagCoreBundle:Entry')
->findByUrlAndUserId($url, $this->getLoggedInUserId());
->getRepository('WallabagCoreBundle:Entry')
->findByUrlAndUserId($url, $this->getLoggedInUserId());
$authors = $content->getPublishedBy();
$this->assertSame('2017-04-05 19:26:13', $content->getPublishedAt()->format('Y-m-d H:i:s'));
$this->assertSame('fr', $content->getLanguage());
$authors = $content->getPublishedBy();
$this->assertSame('2017-04-05 19:26:13', $content->getPublishedAt()->format('Y-m-d H:i:s'));
$this->assertSame('fr', $content->getLanguage());
- $this->assertGreaterThan(1, $title = $crawler->filter('div[id=article] h1')->extract(['_text']));
+ $title = $crawler->filter('div[id=article] h1')->extract(['_text']);
+ $this->assertGreaterThan(1, $title);
- $this->assertSame(1, count($stats = $crawler->filter('div[class=tools] ul[class=stats] li a[class=tool]')->extract(['_text'])));
+
+ $stats = $crawler->filter('div[class=tools] ul[class=stats] li a[class=tool]')->extract(['_text']);
+ $this->assertCount(1, $stats);
$content->setMimetype('text/html');
$content->setTitle('test title entry');
$content->setContent('This is my content /o/');
$content->setMimetype('text/html');
$content->setTitle('test title entry');
$content->setContent('This is my content /o/');
$client->request('GET', '/share/' . $content->getId());
$this->assertSame(302, $client->getResponse()->getStatusCode());
$client->request('GET', '/share/' . $content->getId());
$this->assertSame(302, $client->getResponse()->getStatusCode());
- // follow link with uid
- $crawler = $client->followRedirect();
+ $shareUrl = $client->getResponse()->getTargetUrl();
+
+ // use a new client to have a fresh empty session (instead of a logged one from the previous client)
+ $client->restart();
+
+ $client->request('GET', $shareUrl);
+
$this->assertSame(200, $client->getResponse()->getStatusCode());
$this->assertContains('max-age=25200', $client->getResponse()->headers->get('cache-control'));
$this->assertContains('public', $client->getResponse()->headers->get('cache-control'));
$this->assertSame(200, $client->getResponse()->getStatusCode());
$this->assertContains('max-age=25200', $client->getResponse()->headers->get('cache-control'));
$this->assertContains('public', $client->getResponse()->headers->get('cache-control'));
$client->request('GET', '/share/' . $content->getUid());
$this->assertSame(404, $client->getResponse()->getStatusCode());
$client->request('GET', '/share/' . $content->getUid());
$this->assertSame(404, $client->getResponse()->getStatusCode());
// removing the share
$client->request('GET', '/share/delete/' . $content->getId());
$this->assertSame(302, $client->getResponse()->getStatusCode());
// removing the share
$client->request('GET', '/share/delete/' . $content->getId());
$this->assertSame(302, $client->getResponse()->getStatusCode());
$entry = new Entry($this->getLoggedInUser());
$entry->setUrl('http://0.0.0.0/foo/baz/qux');
$entry->setTitle('Le manège');
$entry = new Entry($this->getLoggedInUser());
$entry->setUrl('http://0.0.0.0/foo/baz/qux');
$entry->setTitle('Le manège');
$entry = new Entry($this->getLoggedInUser());
$entry->setUrl('http://domain/qux');
$entry->setTitle('Le manège');
$entry = new Entry($this->getLoggedInUser());
$entry->setUrl('http://domain/qux');
$entry->setTitle('Le manège');