php-cs-fixer

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
This commit is contained in:
Kevin Decherf
2018-09-05 14:25:32 +02:00
parent 685a5d745e
commit 2a1ceb67b4
48 changed files with 89 additions and 89 deletions

View File

@ -28,7 +28,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
$this->assertSame(200, $client->getResponse()->getStatusCode());
$newNbClients = $em->getRepository('WallabagApiBundle:Client')->findAll();
$this->assertGreaterThan(count($nbClients), count($newNbClients));
$this->assertGreaterThan(\count($nbClients), \count($newNbClients));
$this->assertGreaterThan(1, $alert = $crawler->filter('.settings ul li strong')->extract(['_text']));
$this->assertContains('My app', $alert[0]);
@ -65,7 +65,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/developer');
$this->assertSame(200, $client->getResponse()->getStatusCode());
$this->assertSame(count($nbClients), $crawler->filter('ul[class=collapsible] li')->count());
$this->assertSame(\count($nbClients), $crawler->filter('ul[class=collapsible] li')->count());
}
public function testDeveloperHowto()

View File

@ -28,7 +28,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$this->assertSame($entry->getTitle(), $content['title']);
$this->assertSame($entry->getUrl(), $content['url']);
$this->assertCount(count($entry->getTags()), $content['tags']);
$this->assertCount(\count($entry->getTags()), $content['tags']);
$this->assertSame($entry->getUserName(), $content['user_name']);
$this->assertSame($entry->getUserEmail(), $content['user_email']);
$this->assertSame($entry->getUserId(), $content['user_id']);
@ -127,7 +127,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertGreaterThanOrEqual(1, count($content));
$this->assertGreaterThanOrEqual(1, \count($content));
$this->assertNotEmpty($content['_embedded']['items']);
$this->assertGreaterThanOrEqual(1, $content['total']);
$this->assertSame(1, $content['page']);
@ -154,7 +154,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertGreaterThanOrEqual(1, count($content));
$this->assertGreaterThanOrEqual(1, \count($content));
$this->assertArrayHasKey('items', $content['_embedded']);
$this->assertGreaterThanOrEqual(0, $content['total']);
$this->assertSame(1, $content['page']);
@ -206,7 +206,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertGreaterThanOrEqual(1, count($content));
$this->assertGreaterThanOrEqual(1, \count($content));
$this->assertArrayHasKey('items', $content['_embedded']);
$this->assertGreaterThanOrEqual(1, $content['total']);
$this->assertSame(1, $content['page']);
@ -250,7 +250,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertGreaterThanOrEqual(1, count($content));
$this->assertGreaterThanOrEqual(1, \count($content));
$this->assertNotEmpty($content['_embedded']['items']);
$this->assertGreaterThanOrEqual(1, $content['total']);
$this->assertSame(1, $content['page']);
@ -278,7 +278,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertGreaterThanOrEqual(1, count($content));
$this->assertGreaterThanOrEqual(1, \count($content));
$this->assertNotEmpty($content['_embedded']['items']);
$this->assertGreaterThanOrEqual(1, $content['total']);
$this->assertSame(1, $content['page']);
@ -305,7 +305,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertGreaterThanOrEqual(1, count($content));
$this->assertGreaterThanOrEqual(1, \count($content));
$this->assertNotEmpty($content['_embedded']['items']);
$this->assertGreaterThanOrEqual(1, $content['total']);
$this->assertSame(1, $content['page']);
@ -342,7 +342,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertGreaterThanOrEqual(1, count($content));
$this->assertGreaterThanOrEqual(1, \count($content));
$this->assertNotEmpty($content['_embedded']['items']);
$this->assertGreaterThanOrEqual(1, $content['total']);
$this->assertSame(1, $content['page']);
@ -370,7 +370,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertGreaterThanOrEqual(1, count($content));
$this->assertGreaterThanOrEqual(1, \count($content));
$this->assertEmpty($content['_embedded']['items']);
$this->assertSame(0, $content['total']);
$this->assertSame(1, $content['page']);
@ -608,7 +608,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$this->assertSame($entry->getId(), $content['id']);
$this->assertSame($entry->getUrl(), $content['url']);
$this->assertSame('New awesome title', $content['title']);
$this->assertGreaterThanOrEqual(1, count($content['tags']), 'We force only one tag');
$this->assertGreaterThanOrEqual(1, \count($content['tags']), 'We force only one tag');
$this->assertSame(1, $content['user_id']);
$this->assertSame('de_AT', $content['language']);
$this->assertSame('http://preview.io/picture.jpg', $content['preview_picture']);
@ -647,7 +647,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$this->assertSame($entry->getId(), $content['id']);
$this->assertSame($entry->getUrl(), $content['url']);
$this->assertGreaterThanOrEqual(1, count($content['tags']), 'We force only one tag');
$this->assertGreaterThanOrEqual(1, \count($content['tags']), 'We force only one tag');
$this->assertEmpty($content['published_by'], 'Authors were not saved because of an array instead of a string');
$this->assertSame($previousContent, $content['content'], 'Ensure content has not moved');
$this->assertSame($previousLanguage, $content['language'], 'Ensure language has not moved');
@ -772,7 +772,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$this->markTestSkipped('No content found in db.');
}
$nbTags = count($entry->getTags());
$nbTags = \count($entry->getTags());
$newTags = 'tag1,tag2,tag3';
@ -783,7 +783,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertArrayHasKey('tags', $content);
$this->assertSame($nbTags + 3, count($content['tags']));
$this->assertSame($nbTags + 3, \count($content['tags']));
$entryDB = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
@ -813,7 +813,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
}
// hydrate the tags relations
$nbTags = count($entry->getTags());
$nbTags = \count($entry->getTags());
$tag = $entry->getTags()[0];
$this->client->request('DELETE', '/api/entries/' . $entry->getId() . '/tags/' . $tag->getId() . '.json');
@ -823,7 +823,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertArrayHasKey('tags', $content);
$this->assertSame($nbTags - 1, count($content['tags']));
$this->assertSame($nbTags - 1, \count($content['tags']));
}
public function testSaveIsArchivedAfterPost()

View File

@ -524,7 +524,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->assertGreaterThan(1, $title = $crawler->filter('div[id=article] h1')->extract(['_text']));
$this->assertContains('My updated title hehe :)', $title[0]);
$this->assertSame(1, count($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]));
}

View File

@ -180,7 +180,7 @@ class ExportControllerTest extends WallabagCoreTestCase
$this->assertGreaterThan(1, $csv);
// +1 for title line
$this->assertSame(count($contentInDB) + 1, count($csv));
$this->assertSame(\count($contentInDB) + 1, \count($csv));
$this->assertSame('Title;URL;Content;Tags;"MIME Type";Language;"Creation date"', $csv[0]);
$this->assertContains($contentInDB[0]['title'], $csv[1]);
$this->assertContains($contentInDB[0]['url'], $csv[1]);
@ -272,7 +272,7 @@ class ExportControllerTest extends WallabagCoreTestCase
$content = new \SimpleXMLElement($client->getResponse()->getContent());
$this->assertGreaterThan(0, $content->count());
$this->assertSame(count($contentInDB), $content->count());
$this->assertSame(\count($contentInDB), $content->count());
$this->assertNotEmpty('id', (string) $content->entry[0]->id);
$this->assertNotEmpty('title', (string) $content->entry[0]->title);
$this->assertNotEmpty('url', (string) $content->entry[0]->url);

View File

@ -98,7 +98,7 @@ class TagControllerTest extends WallabagCoreTestCase
$tags[$key] = $tag->getLabel();
}
$this->assertGreaterThanOrEqual(2, count($tags));
$this->assertGreaterThanOrEqual(2, \count($tags));
$this->assertNotFalse(array_search('foo2', $tags, true), 'Tag foo2 is assigned to the entry');
$this->assertNotFalse(array_search('bar2', $tags, true), 'Tag bar2 is assigned to the entry');
}

View File

@ -121,7 +121,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
$this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content);
$this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.usinenouvelle.com is ok');
$this->assertNotEmpty($content->getLanguage(), 'Language for http://www.usinenouvelle.com is ok');
$this->assertSame(1, count($content->getTags()));
$this->assertSame(1, \count($content->getTags()));
$createdAt = $content->getCreatedAt();
$this->assertSame('2011', $createdAt->format('Y'));

View File

@ -122,7 +122,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
$this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://lexpansion.lexpress.fr is ok');
$this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://lexpansion.lexpress.fr is ok');
$this->assertNotEmpty($content->getLanguage(), 'Language for http://lexpansion.lexpress.fr is ok');
$this->assertSame(3, count($content->getTags()));
$this->assertSame(3, \count($content->getTags()));
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')

View File

@ -122,7 +122,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
$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->assertContains('foot', $content->getTags(), 'It includes the "foot" tag');
$this->assertSame(1, count($content->getTags()));
$this->assertSame(1, \count($content->getTags()));
$this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());
$content = $client->getContainer()
@ -136,7 +136,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
$this->assertContains('foot', $content->getTags());
$this->assertContains('test_tag', $content->getTags());
$this->assertSame(2, count($content->getTags()));
$this->assertSame(2, \count($content->getTags()));
}
public function testImportInstapaperWithFileAndMarkAllAsRead()

View File

@ -127,7 +127,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
$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->assertSame(3, count($tags));
$this->assertSame(3, \count($tags));
$this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());
$this->assertSame('2016-10-26', $content->getCreatedAt()->format('Y-m-d'));

View File

@ -125,7 +125,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
$tags = $content->getTags();
$this->assertContains('foot', $tags, 'It includes the "foot" tag');
$this->assertSame(1, count($tags));
$this->assertSame(1, \count($tags));
$this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());
$this->assertSame('2016-09-08', $content->getCreatedAt()->format('Y-m-d'));

View File

@ -127,7 +127,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$tags = $content->getTags();
$this->assertContains('foot', $tags, 'It includes the "foot" tag');
$this->assertContains('framabag', $tags, 'It includes the "framabag" tag');
$this->assertSame(2, count($tags));
$this->assertSame(2, \count($tags));
$this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());
}

View File

@ -128,7 +128,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$tags = $content->getTags();
$this->assertContains('foot', $tags, 'It includes the "foot" tag');
$this->assertSame(1, count($tags));
$this->assertSame(1, \count($tags));
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
@ -147,7 +147,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$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->assertSame(3, count($tags));
$this->assertSame(3, \count($tags));
$this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());
$this->assertSame('2016-09-08', $content->getCreatedAt()->format('Y-m-d'));

View File

@ -13,7 +13,7 @@ final class CountableMemorySpool extends \Swift_MemorySpool implements \Countabl
{
public function count()
{
return count($this->messages);
return \count($this->messages);
}
public function getMessages()