Fixed code style.

This commit is contained in:
Jan Böhmer 2020-01-04 20:24:09 +01:00
parent 1aed1d1d26
commit 9a7223a301
142 changed files with 534 additions and 716 deletions

View file

@ -24,7 +24,6 @@ namespace App\Tests\Repository;
use App\Entity\Attachments\AttachmentType;
use App\Helpers\Trees\TreeViewNode;
use App\Repository\StructuralDBElementRepository;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
/**
@ -32,15 +31,14 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
*/
class StructuralDBElementRepositoryTest extends WebTestCase
{
private $entityManager;
/** @var StructuralDBElementRepository */
private $repo;
/**
* {@inheritDoc}
* {@inheritdoc}
*/
protected function setUp() : void
protected function setUp(): void
{
$kernel = self::bootKernel();
@ -51,7 +49,7 @@ class StructuralDBElementRepositoryTest extends WebTestCase
$this->repo = $this->entityManager->getRepository(AttachmentType::class);
}
public function testFindRootNodes() : void
public function testFindRootNodes(): void
{
$root_nodes = $this->repo->findRootNodes();
$this->assertCount(3, $root_nodes);
@ -63,7 +61,7 @@ class StructuralDBElementRepositoryTest extends WebTestCase
$this->assertEquals('Node 3', $root_nodes[2]->getName());
}
public function testGetGenericTree() : void
public function testGetGenericTree(): void
{
$tree = $this->repo->getGenericNodeTree();
$this->assertIsArray($tree);
@ -86,13 +84,12 @@ class StructuralDBElementRepositoryTest extends WebTestCase
$this->assertEquals(1, $tree[0]->getId());
$this->assertEquals(2, $tree[1]->getId());
$this->assertEquals(7, $tree[0]->getNodes()[0]->getNodes()[0]->getId());
}
/**
* Test $repo->toNodesList() for null as parameter
* Test $repo->toNodesList() for null as parameter.
*/
public function testToNodesListRoot() : void
public function testToNodesListRoot(): void
{
//List all root nodes and their children
$nodes = $this->repo->toNodesList();
@ -108,7 +105,7 @@ class StructuralDBElementRepositoryTest extends WebTestCase
$this->assertEquals('Node 3', $nodes[6]->getName());
}
public function testToNodesListElement() : void
public function testToNodesListElement(): void
{
//List all nodes that are children to Node 1
$node1 = $this->repo->find(1);