Applied code formator

This commit is contained in:
Kevin Frantz 2018-11-04 12:25:53 +01:00
parent 00ae6412e6
commit 577f30e0f7
8 changed files with 29 additions and 24 deletions

View File

@ -8,8 +8,8 @@ use App\Entity\User;
/**
* Never execute this fixture on a livesystem!
* @author kevinfrantz
*
* @author kevinfrantz
*/
class DummyFixtures extends Fixture
{

View File

@ -1,7 +1,10 @@
<?php
namespace App\Entity\Source\Data;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Source\AbstractSource;
use App\Entity\Source\AbstractSource;
/**
* @author kevinfrantz
*
@ -13,6 +16,4 @@ use App\Entity\Source\AbstractSource;
*/
abstract class AbstractDataSource extends AbstractSource implements DataSourceInterface
{
}

View File

@ -1,4 +1,5 @@
<?php
namespace App\Entity\Source\Data;
use App\Entity\Source\SourceInterface;
@ -6,4 +7,3 @@ use App\Entity\Source\SourceInterface;
interface DataSourceInterface extends SourceInterface
{
}

View File

@ -11,7 +11,7 @@ use Symfony\Component\Validator\Constraints as Assert;
* @ORM\Table(name="source_data_name")
* @ORM\Entity(repositoryClass="App\Repository\NameSourceRepository")
*/
final class NameSource extends AbstractDataSource implements NameSourceInterface
final class NameSource extends AbstractDataSource implements NameSourceInterface
{
use NameAttribut;

View File

@ -4,7 +4,6 @@ namespace App\Entity\Source\Data;
use App\Entity\Attribut\UserAttributInterface;
use App\Entity\Attribut\NameSourceAttributInterface;
use App\Entity\Source\SourceInterface;
/**
* @author kevinfrantz

View File

@ -1,4 +1,5 @@
<?php
namespace App\Entity\Attribut;
use PHPUnit\Framework\TestCase;
@ -9,22 +10,24 @@ class NameAttributTest extends TestCase
* @var NameAttributInterface
*/
public $name;
public function setUp():void{
$this->name = new class implements NameAttributInterface{
public function setUp(): void
{
$this->name = new class() implements NameAttributInterface {
use NameAttribut;
};
}
public function testConstructor():void{
public function testConstructor(): void
{
$this->expectException(\TypeError::class);
$this->name->getName();
}
public function testAccessors():void{
$name = "hello world!";
public function testAccessors(): void
{
$name = 'hello world!';
$this->assertNull($this->name->setName($name));
$this->assertEquals($name, $this->name->getName());
}
}

View File

@ -21,12 +21,13 @@ class NameSourceTest extends TestCase
$this->nameSource = new NameSource();
}
public function testConstructor():void{
public function testConstructor(): void
{
$this->assertInstanceOf(NameSourceInterface::class, $this->nameSource);
$this->expectException(\TypeError::class);
$this->nameSource->getName();
}
public function testName(): void
{
$name = 'Hello World!';

View File

@ -1,4 +1,5 @@
<?php
namespace tests\unit\Entity\Source\Data;
use PHPUnit\Framework\TestCase;
@ -10,18 +11,18 @@ use App\Entity\Source\Data\NameSourceInterface;
class UserSourceTest extends TestCase
{
/**
*
* @var UserSourceInterface
*/
public $userSource;
public function setUp():void{
public function setUp(): void
{
$this->userSource = new UserSource();
}
public function testConstructor():void {
public function testConstructor(): void
{
$this->assertInstanceOf(Collection::class, $this->userSource->getMemberships());
$this->assertInstanceOf(NameSourceInterface::class, $this->userSource->getNameSource());
}
}