Fixed some tests.

This commit is contained in:
Jan Böhmer 2020-01-02 23:03:25 +01:00
parent d9b15ddbb9
commit fbcfc1f2a8
3 changed files with 6 additions and 4 deletions

View file

@ -40,7 +40,7 @@ class NamedDBElementRepository extends EntityRepository
{ {
$result = []; $result = [];
$entities = $this->findAll(); $entities = $this->findBy([], ['name' => 'ASC']);
foreach ($entities as $entity) { foreach ($entities as $entity) {
/** @var $entity NamedDBElement */ /** @var $entity NamedDBElement */
$node = new TreeViewNode($entity->getName(), null, null); $node = new TreeViewNode($entity->getName(), null, null);

View file

@ -27,6 +27,8 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
/** /**
* This test just ensures that different pages are available (do not throw an exception) * This test just ensures that different pages are available (do not throw an exception)
* @package App\Tests * @package App\Tests
* @group DB
* @group slow
*/ */
class ApplicationAvailabilityFunctionalTest extends WebTestCase class ApplicationAvailabilityFunctionalTest extends WebTestCase
{ {
@ -46,14 +48,14 @@ class ApplicationAvailabilityFunctionalTest extends WebTestCase
$client->request('GET', $url); $client->request('GET', $url);
$this->assertTrue($client->getResponse()->isSuccessful()); $this->assertTrue($client->getResponse()->isSuccessful(), 'Request not successful. Status code is ' . $client->getResponse()->getStatusCode());
} }
public function urlProvider() public function urlProvider()
{ {
//Homepage //Homepage
yield ['/']; //yield ['/'];
//User related things //User related things
yield ['/user/settings']; yield ['/user/settings'];
yield ['/user/info']; yield ['/user/info'];

View file

@ -60,7 +60,7 @@ class NamedDBElementRepositoryTest extends WebTestCase
$this->assertIsArray($tree); $this->assertIsArray($tree);
$this->assertContainsOnlyInstancesOf(TreeViewNode::class, $tree); $this->assertContainsOnlyInstancesOf(TreeViewNode::class, $tree);
$this->assertCount(4, $tree); $this->assertCount(4, $tree);
$this->assertEquals('anonymous', $tree[0]->getText()); $this->assertEquals('admin', $tree[0]->getText());
$this->assertEmpty($tree[0]->getNodes()); $this->assertEmpty($tree[0]->getNodes());
} }
} }