Applied code formator

This commit is contained in:
Kevin Frantz 2018-11-06 20:08:28 +01:00
parent a3bbd64f43
commit 1fa93e577a
5 changed files with 21 additions and 26 deletions

View File

@ -4,7 +4,6 @@ namespace App\Entity\Meta;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Attribut\MembersAttribut;
use App\Entity\Source\SourceInterface;
use App\Entity\Attribut\RightAttribut;
use App\Entity\Attribut\CollectionAttribut;

View File

@ -2,7 +2,6 @@
namespace App\Entity\Meta;
use App\Entity\Attribut\MembersAttributInterface;
use App\Entity\Attribut\RightAttributInterface;
use App\Entity\Attribut\CollectionAttributInterface;
use App\Helper\DimensionHelperInterface;

View File

@ -34,8 +34,10 @@ class CollectionAttributTest extends TestCase
$this->assertEquals($collection, $this->collection->getCollection());
}
public function testAdd():void{
$mock = new class{};
public function testAdd(): void
{
$mock = new class() {
};
$this->collection->setCollection(new ArrayCollection());
$this->assertTrue($this->collection->getCollection()->add($mock));
$this->assertEquals($mock, $this->collection->getCollection()->get(0));

View File

@ -1,4 +1,5 @@
<?php
namespace Tests\Unit\Entity\Attribut;
use PHPUnit\Framework\TestCase;
@ -9,26 +10,27 @@ use App\Entity\Meta\RecieverInterface;
class RecieverAttributTest extends TestCase
{
/**
*
* @var RecieverAttributInterface
*/
protected $reciever;
public function setUp():void{
$this->reciever = new class implements RecieverAttributInterface{
public function setUp(): void
{
$this->reciever = new class() implements RecieverAttributInterface {
use RecieverAttribut;
};
}
public function testConstructor():void{
public function testConstructor(): void
{
$this->expectException(\TypeError::class);
$this->reciever->getReciever();
}
public function testAccessors():void{
public function testAccessors(): void
{
$reciever = $this->createMock(RecieverInterface::class);
$this->assertNull($this->reciever->setReciever($reciever));
$this->assertEquals($reciever, $this->reciever->getReciever());
}
}

View File

@ -1,14 +1,11 @@
<?php
namespace Tests\Unit\Entity\Subscriber;
use App\Subscriber\SourceMenuSubscriber;
use App\Subscriber\UserMenuSubscriber;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
use Symfony\Component\Translation\Translator;
use App\Event\Menu\MenuEvent;
use PHPUnit\Framework\TestCase;
use Knp\Menu\FactoryInterface;
use Knp\Menu\ItemInterface;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Request;
use Knp\Menu\MenuItem;
@ -16,9 +13,7 @@ use Knp\Menu\MenuFactory;
class SourceMenuSubscriberTest extends TestCase
{
/**
*
* @var SourceMenuSubscriber
*/
public $subscriber;
@ -29,7 +24,8 @@ class SourceMenuSubscriberTest extends TestCase
$this->subscriber = new SourceMenuSubscriber($translator);
}
public function testOnSourceMenuConfig():void{
public function testOnSourceMenuConfig(): void
{
$factory = new MenuFactory();
$item = new MenuItem('test', $factory);
$request = new Request();
@ -40,6 +36,3 @@ class SourceMenuSubscriberTest extends TestCase
$this->assertNull($this->subscriber->onSourceMenuConfigure($event));
}
}