$this->assertSame($previousLanguage, $content['language'], 'Ensure language has not moved');
$this->assertSame($previousTitle, $content['title'], 'Ensure title has not moved');
}
-
- public function testPatchEntryNullOriginUrl()
- {
- $entry = $this->client->getContainer()
+
+ public function testPatchEntryNullOriginUrl()
+ {
+ $entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->findOneByUser(1);
-
- if (!$entry) {
- $this->markTestSkipped('No content found in db.');
- }
-
- $this->client->request('PATCH', '/api/entries/' . $entry->getId() . '.json', [
+
+ if (!$entry) {
+ $this->markTestSkipped('No content found in db.');
+ }
+
+ $this->client->request('PATCH', '/api/entries/' . $entry->getId() . '.json', [
'origin_url' => null,
]);
-
- $this->assertSame(200, $this->client->getResponse()->getStatusCode());
-
- $content = json_decode($this->client->getResponse()->getContent(), true);
-
- $this->assertNull($content['origin_url']);
- }
+
+ $this->assertSame(200, $this->client->getResponse()->getStatusCode());
+
+ $content = json_decode($this->client->getResponse()->getContent(), true);
+
+ $this->assertNull($content['origin_url']);
+ }
public function testGetTagsEntry()
{
$this->assertGreaterThan(1, $title = $crawler->filter('div[id=article] h1')->extract(['_text']));
$this->assertContains('My updated title hehe :)', $title[0]);
- $this->assertSame(1, sizeof($stats = $crawler->filter('div[class=tools] ul[class=stats] li a[class=tool]')->extract(['_text'])));
+ $this->assertSame(1, count($stats = $crawler->filter('div[class=tools] ul[class=stats] li a[class=tool]')->extract(['_text'])));
$this->assertNotContains('example.io', trim($stats[0]));
}
->getMock();
$extension = new WallabagExtension($entryRepository, $tagRepository, $tokenStorage, 0, $translator);
-
+
$this->assertSame('lemonde.fr', $extension->removeSchemeAndWww('www.lemonde.fr'));
$this->assertSame('lemonde.fr', $extension->removeSchemeAndWww('http://lemonde.fr'));
$this->assertSame('lemonde.fr', $extension->removeSchemeAndWww('https://www.lemonde.fr'));