mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 21:57:16 +02:00
Applied CS fixer
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace tests\unit\Entity\Source;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
@@ -10,9 +11,7 @@ use Doctrine\Common\Collections\ArrayCollection;
|
||||
use App\Entity\Source\AbstractSource;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
class AbstractSourceTest extends TestCase
|
||||
{
|
||||
@@ -21,30 +20,36 @@ class AbstractSourceTest extends TestCase
|
||||
* @var SourceInterface
|
||||
*/
|
||||
protected $source;
|
||||
|
||||
public function setUp(){
|
||||
$this->source = new class extends \App\Entity\Source\AbstractSource{};
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->source = new class() extends \App\Entity\Source\AbstractSource {
|
||||
};
|
||||
$this->source->setId(self::ID);
|
||||
}
|
||||
|
||||
public function testId(){
|
||||
$this->assertEquals($this->source->getId(),self::ID);
|
||||
|
||||
public function testId()
|
||||
{
|
||||
$this->assertEquals($this->source->getId(), self::ID);
|
||||
}
|
||||
|
||||
public function testLaw(){
|
||||
$this->assertInstanceOf(LawInterface::class,$this->source->getLaw());
|
||||
|
||||
public function testLaw()
|
||||
{
|
||||
$this->assertInstanceOf(LawInterface::class, $this->source->getLaw());
|
||||
}
|
||||
|
||||
public function testRelation(){
|
||||
$this->assertInstanceOf(RelationInterface::class,$this->source->getRelation());
|
||||
|
||||
public function testRelation()
|
||||
{
|
||||
$this->assertInstanceOf(RelationInterface::class, $this->source->getRelation());
|
||||
}
|
||||
|
||||
public function testGroups(){
|
||||
$this->assertInstanceOf(Collection::class,$this->source->getGroupSources());
|
||||
$group = new class extends AbstractSource{};
|
||||
|
||||
public function testGroups()
|
||||
{
|
||||
$this->assertInstanceOf(Collection::class, $this->source->getGroupSources());
|
||||
$group = new class() extends AbstractSource {
|
||||
};
|
||||
$groups = new ArrayCollection([$group]);
|
||||
$this->source->setGroupSources($groups);
|
||||
$this->assertEquals($group, $this->source->getGroupSources()->get(0));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace tests\unit\Entity\Source;
|
||||
|
||||
use App\Entity\Source\GroupSourceInterface;
|
||||
@@ -9,27 +10,26 @@ use Doctrine\Common\Collections\ArrayCollection;
|
||||
use App\Entity\Source\AbstractSource;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
class GroupSourceTest extends TestCase
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @var GroupSourceInterface
|
||||
*/
|
||||
protected $groupSource;
|
||||
|
||||
public function setUp():void {
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
$this->groupSource = new GroupSource();
|
||||
}
|
||||
|
||||
public function testMembers(){
|
||||
|
||||
public function testMembers()
|
||||
{
|
||||
$this->assertInstanceOf(Collection::class, $this->groupSource->getMembers());
|
||||
$member = new class extends AbstractSource{};
|
||||
$member = new class() extends AbstractSource {
|
||||
};
|
||||
$this->groupSource->setMembers(new ArrayCollection([$member]));
|
||||
$this->assertEquals($member, $this->groupSource->getMembers()->get(0));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace tests\unit\Entity\Source;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
@@ -6,15 +7,11 @@ use App\Entity\Source\NameSourceInterface;
|
||||
use App\Entity\Source\NameSource;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
class NameSourceTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* @var NameSourceInterface
|
||||
*/
|
||||
protected $nameSource;
|
||||
@@ -23,12 +20,12 @@ class NameSourceTest extends TestCase
|
||||
{
|
||||
$this->nameSource = new NameSource();
|
||||
}
|
||||
|
||||
public function testName():void{
|
||||
|
||||
public function testName(): void
|
||||
{
|
||||
$this->assertEquals('', $this->nameSource->getName());
|
||||
$name = 'Hello World!';
|
||||
$this->nameSource->setName($name);
|
||||
$this->assertEquals($name, $this->nameSource->getName());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -27,10 +27,10 @@ class UserTest extends TestCase
|
||||
$this->user = new User();
|
||||
$this->user->setUsername(self::USERNAME);
|
||||
$this->user->setPassword(self::PASSWORD);
|
||||
|
||||
}
|
||||
|
||||
public function testConstructor():void{
|
||||
|
||||
public function testConstructor(): void
|
||||
{
|
||||
$this->assertInstanceOf(UserInterface::class, new User());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user