Release 2.12 (#4609)
This commit is contained in:
@@ -17,7 +17,7 @@ abstract class AbstractCommentEntityTest extends TestCase
|
||||
{
|
||||
abstract protected function getEntity(): CommentInterface;
|
||||
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$sut = $this->getEntity();
|
||||
|
||||
@@ -29,7 +29,7 @@ abstract class AbstractCommentEntityTest extends TestCase
|
||||
self::assertFalse($sut->isPinned());
|
||||
}
|
||||
|
||||
public function testSetterAndGetter()
|
||||
public function testSetterAndGetter(): void
|
||||
{
|
||||
$sut = $this->getEntity();
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ use PHPUnit\Framework\TestCase;
|
||||
|
||||
abstract class AbstractEntityTest extends TestCase
|
||||
{
|
||||
protected function assertBudget(EntityWithBudget $entityWithBudget)
|
||||
public function assertBudget(EntityWithBudget $entityWithBudget): void
|
||||
{
|
||||
$this->assertEquals(0.0, $entityWithBudget->getBudget());
|
||||
$this->assertEquals(0, $entityWithBudget->getTimeBudget());
|
||||
|
||||
@@ -23,7 +23,7 @@ abstract class AbstractMetaEntityTest extends TestCase
|
||||
|
||||
abstract protected function getMetaEntity(): MetaTableTypeInterface;
|
||||
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$sut = $this->getMetaEntity();
|
||||
self::assertNull($sut->getLabel());
|
||||
@@ -40,7 +40,7 @@ abstract class AbstractMetaEntityTest extends TestCase
|
||||
self::assertEquals(0, $sut->getOrder());
|
||||
}
|
||||
|
||||
public function testSetterAndGetter()
|
||||
public function testSetterAndGetter(): void
|
||||
{
|
||||
$sut = $this->getMetaEntity();
|
||||
self::assertInstanceOf(MetaTableTypeInterface::class, $sut->setName('foo-bar'));
|
||||
@@ -85,7 +85,7 @@ abstract class AbstractMetaEntityTest extends TestCase
|
||||
self::assertSame($entity, $sut->getEntity());
|
||||
}
|
||||
|
||||
public function testMerge()
|
||||
public function testMerge(): void
|
||||
{
|
||||
$entity1 = $this->getEntity();
|
||||
$entity2 = $this->getEntity();
|
||||
|
||||
@@ -30,7 +30,7 @@ class ActivityMetaTest extends AbstractMetaEntityTest
|
||||
return new ActivityMeta();
|
||||
}
|
||||
|
||||
public function testSetEntityThrowsException()
|
||||
public function testSetEntityThrowsException(): void
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Expected instanceof Activity, received "App\Entity\Timesheet"');
|
||||
|
||||
@@ -20,7 +20,7 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class ActivityRateTest extends TestCase
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$sut = new ActivityRate();
|
||||
self::assertNull($sut->getId());
|
||||
@@ -32,7 +32,7 @@ class ActivityRateTest extends TestCase
|
||||
self::assertFalse($sut->isFixed());
|
||||
}
|
||||
|
||||
public function testSetterAndGetter()
|
||||
public function testSetterAndGetter(): void
|
||||
{
|
||||
$sut = new ActivityRate();
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ use Doctrine\Common\Collections\Collection;
|
||||
*/
|
||||
class ActivityTest extends AbstractEntityTest
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$sut = new Activity();
|
||||
$this->assertNull($sut->getId());
|
||||
@@ -42,12 +42,12 @@ class ActivityTest extends AbstractEntityTest
|
||||
$this->assertInstanceOf(Collection::class, $sut->getTeams());
|
||||
}
|
||||
|
||||
public function testBudgets()
|
||||
public function testBudgets(): void
|
||||
{
|
||||
$this->assertBudget(new Activity());
|
||||
}
|
||||
|
||||
public function testSetterAndGetter()
|
||||
public function testSetterAndGetter(): void
|
||||
{
|
||||
$sut = new Activity();
|
||||
$this->assertInstanceOf(Activity::class, $sut->setName('foo-bar'));
|
||||
@@ -82,7 +82,7 @@ class ActivityTest extends AbstractEntityTest
|
||||
$this->assertFalse($sut->isGlobal());
|
||||
}
|
||||
|
||||
public function testMetaFields()
|
||||
public function testMetaFields(): void
|
||||
{
|
||||
$sut = new Activity();
|
||||
$meta = new ActivityMeta();
|
||||
@@ -110,7 +110,7 @@ class ActivityTest extends AbstractEntityTest
|
||||
self::assertCount(2, $sut->getVisibleMetaFields());
|
||||
}
|
||||
|
||||
public function testTeams()
|
||||
public function testTeams(): void
|
||||
{
|
||||
$sut = new Activity();
|
||||
$team = new Team('foo');
|
||||
@@ -133,7 +133,7 @@ class ActivityTest extends AbstractEntityTest
|
||||
self::assertCount(0, $team->getActivities());
|
||||
}
|
||||
|
||||
public function testExportAnnotations()
|
||||
public function testExportAnnotations(): void
|
||||
{
|
||||
$sut = new AnnotationExtractor();
|
||||
|
||||
@@ -169,7 +169,7 @@ class ActivityTest extends AbstractEntityTest
|
||||
}
|
||||
}
|
||||
|
||||
public function testClone()
|
||||
public function testClone(): void
|
||||
{
|
||||
$sut = new Activity();
|
||||
$sut->setName('activity1111');
|
||||
|
||||
@@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class BookmarkTest extends TestCase
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$sut = new Bookmark();
|
||||
$this->assertNull($sut->getId());
|
||||
@@ -29,7 +29,7 @@ class BookmarkTest extends TestCase
|
||||
$this->assertNull($sut->getUser());
|
||||
}
|
||||
|
||||
public function testSetterAndGetter()
|
||||
public function testSetterAndGetter(): void
|
||||
{
|
||||
$sut = new Bookmark();
|
||||
$sut->setName('foo-bar');
|
||||
|
||||
@@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class ConfigurationTest extends TestCase
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$sut = new Configuration();
|
||||
$this->assertNull($sut->getId());
|
||||
@@ -25,7 +25,7 @@ class ConfigurationTest extends TestCase
|
||||
$this->assertNull($sut->getValue());
|
||||
}
|
||||
|
||||
public function testSetterAndGetter()
|
||||
public function testSetterAndGetter(): void
|
||||
{
|
||||
$sut = new Configuration();
|
||||
$this->assertInstanceOf(Configuration::class, $sut->setName('foo-bar'));
|
||||
|
||||
@@ -23,7 +23,7 @@ class CustomerCommentTest extends AbstractCommentEntityTest
|
||||
return new CustomerComment(new Customer('foo'));
|
||||
}
|
||||
|
||||
public function testEntitySpecificMethods()
|
||||
public function testEntitySpecificMethods(): void
|
||||
{
|
||||
$sut = $this->getEntity();
|
||||
self::assertNotNull($sut->getCustomer());
|
||||
|
||||
@@ -30,7 +30,7 @@ class CustomerMetaTest extends AbstractMetaEntityTest
|
||||
return new CustomerMeta();
|
||||
}
|
||||
|
||||
public function testSetEntityThrowsException()
|
||||
public function testSetEntityThrowsException(): void
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Expected instanceof Customer, received "App\Entity\Activity"');
|
||||
|
||||
@@ -20,7 +20,7 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class CustomerRateTest extends TestCase
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$sut = new CustomerRate();
|
||||
self::assertNull($sut->getId());
|
||||
@@ -32,7 +32,7 @@ class CustomerRateTest extends TestCase
|
||||
self::assertFalse($sut->isFixed());
|
||||
}
|
||||
|
||||
public function testSetterAndGetter()
|
||||
public function testSetterAndGetter(): void
|
||||
{
|
||||
$sut = new CustomerRate();
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ use Doctrine\Common\Collections\Collection;
|
||||
*/
|
||||
class CustomerTest extends AbstractEntityTest
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$sut = new Customer('foo');
|
||||
self::assertNull($sut->getId());
|
||||
@@ -54,12 +54,12 @@ class CustomerTest extends AbstractEntityTest
|
||||
self::assertEquals(0, $sut->getTeams()->count());
|
||||
}
|
||||
|
||||
public function testBudgets()
|
||||
public function testBudgets(): void
|
||||
{
|
||||
$this->assertBudget(new Customer('foo'));
|
||||
}
|
||||
|
||||
public function testSetterAndGetter()
|
||||
public function testSetterAndGetter(): void
|
||||
{
|
||||
$sut = new Customer('foo-bar');
|
||||
self::assertEquals('foo-bar', $sut->getName());
|
||||
@@ -119,7 +119,7 @@ class CustomerTest extends AbstractEntityTest
|
||||
self::assertNull($sut->getCurrency());
|
||||
}
|
||||
|
||||
public function testMetaFields()
|
||||
public function testMetaFields(): void
|
||||
{
|
||||
$sut = new Customer('foo');
|
||||
$meta = new CustomerMeta();
|
||||
@@ -147,7 +147,7 @@ class CustomerTest extends AbstractEntityTest
|
||||
self::assertCount(2, $sut->getVisibleMetaFields());
|
||||
}
|
||||
|
||||
public function testTeams()
|
||||
public function testTeams(): void
|
||||
{
|
||||
$sut = new Customer('foo');
|
||||
$team = new Team('foo');
|
||||
@@ -171,7 +171,7 @@ class CustomerTest extends AbstractEntityTest
|
||||
self::assertCount(0, $team->getCustomers());
|
||||
}
|
||||
|
||||
public function testExportAnnotations()
|
||||
public function testExportAnnotations(): void
|
||||
{
|
||||
$sut = new AnnotationExtractor();
|
||||
|
||||
@@ -219,7 +219,7 @@ class CustomerTest extends AbstractEntityTest
|
||||
}
|
||||
}
|
||||
|
||||
public function testClone()
|
||||
public function testClone(): void
|
||||
{
|
||||
$sut = new Customer('mycustomer');
|
||||
$sut->setVatId('DE-0123456789');
|
||||
|
||||
@@ -21,7 +21,7 @@ trait EntityValidationTestTrait
|
||||
* @param object $entity
|
||||
* @param array|string $fieldNames
|
||||
*/
|
||||
protected function assertHasViolationForField(object $entity, $fieldNames, $groups = null)
|
||||
public function assertHasViolationForField(object $entity, $fieldNames, $groups = null): void
|
||||
{
|
||||
self::bootKernel();
|
||||
/** @var ValidatorInterface $validator */
|
||||
@@ -56,7 +56,7 @@ trait EntityValidationTestTrait
|
||||
$this->assertEquals($expected, $countViolations, sprintf('Expected %s violations, found %s in %s.', $expected, $actual, implode(', ', array_keys($violatedFields))));
|
||||
}
|
||||
|
||||
protected function assertHasNoViolations($entity, $groups = null)
|
||||
public function assertHasNoViolations($entity, $groups = null): void
|
||||
{
|
||||
self::bootKernel();
|
||||
/** @var ValidatorInterface $validator */
|
||||
|
||||
@@ -30,7 +30,7 @@ class InvoiceMetaTest extends AbstractMetaEntityTest
|
||||
return new InvoiceMeta();
|
||||
}
|
||||
|
||||
public function testSetEntityThrowsException()
|
||||
public function testSetEntityThrowsException(): void
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Expected instanceof Invoice, received "App\Entity\Customer"');
|
||||
|
||||
@@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class InvoiceTemplateTest extends TestCase
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$sut = new InvoiceTemplate();
|
||||
|
||||
@@ -38,7 +38,7 @@ class InvoiceTemplateTest extends TestCase
|
||||
self::assertTrue($sut->isDecimalDuration());
|
||||
}
|
||||
|
||||
public function testSetNullForOptionalValues()
|
||||
public function testSetNullForOptionalValues(): void
|
||||
{
|
||||
$sut = new InvoiceTemplate();
|
||||
|
||||
@@ -49,7 +49,7 @@ class InvoiceTemplateTest extends TestCase
|
||||
self::assertInstanceOf(InvoiceTemplate::class, $sut->setPaymentTerms(null));
|
||||
}
|
||||
|
||||
public function testSetterAndGetter()
|
||||
public function testSetterAndGetter(): void
|
||||
{
|
||||
$sut = new InvoiceTemplate();
|
||||
|
||||
@@ -83,7 +83,7 @@ class InvoiceTemplateTest extends TestCase
|
||||
self::assertEquals($sut, clone $sut);
|
||||
}
|
||||
|
||||
public function testToString()
|
||||
public function testToString(): void
|
||||
{
|
||||
$sut = new InvoiceTemplate();
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class InvoiceTest extends TestCase
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$sut = new Invoice();
|
||||
self::assertNull($sut->getCreatedAt());
|
||||
@@ -58,7 +58,7 @@ class InvoiceTest extends TestCase
|
||||
self::assertNull($sut->getComment());
|
||||
}
|
||||
|
||||
public function testSetInvalidStatus()
|
||||
public function testSetInvalidStatus(): void
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Unknown invoice status');
|
||||
@@ -67,7 +67,7 @@ class InvoiceTest extends TestCase
|
||||
$sut->setStatus('foo');
|
||||
}
|
||||
|
||||
public function testSetterAndGetter()
|
||||
public function testSetterAndGetter(): void
|
||||
{
|
||||
$date = new \DateTime('-2 months');
|
||||
$sut = new Invoice();
|
||||
@@ -219,7 +219,7 @@ class InvoiceTest extends TestCase
|
||||
return new DateNumberGenerator($repository);
|
||||
}
|
||||
|
||||
public function testClone()
|
||||
public function testClone(): void
|
||||
{
|
||||
$sut = new Invoice();
|
||||
$sut->setComment('foo kajsdhgf aksjdhfg');
|
||||
@@ -242,7 +242,7 @@ class InvoiceTest extends TestCase
|
||||
self::assertEquals('foo kajsdhgf aksjdhfg', $clone->getComment());
|
||||
}
|
||||
|
||||
public function testMetaFields()
|
||||
public function testMetaFields(): void
|
||||
{
|
||||
$sut = new Invoice();
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class ProjectCommentTest extends AbstractCommentEntityTest
|
||||
return new ProjectComment(new Project());
|
||||
}
|
||||
|
||||
public function testEntitySpecificMethods()
|
||||
public function testEntitySpecificMethods(): void
|
||||
{
|
||||
$sut = $this->getEntity();
|
||||
self::assertNotNull($sut->getProject());
|
||||
|
||||
@@ -30,7 +30,7 @@ class ProjectMetaTest extends AbstractMetaEntityTest
|
||||
return new ProjectMeta();
|
||||
}
|
||||
|
||||
public function testSetEntityThrowsException()
|
||||
public function testSetEntityThrowsException(): void
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Expected instanceof Project, received "App\Entity\Customer"');
|
||||
|
||||
@@ -20,7 +20,7 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class ProjectRateTest extends TestCase
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$sut = new ProjectRate();
|
||||
self::assertNull($sut->getId());
|
||||
@@ -32,7 +32,7 @@ class ProjectRateTest extends TestCase
|
||||
self::assertFalse($sut->isFixed());
|
||||
}
|
||||
|
||||
public function testSetterAndGetter()
|
||||
public function testSetterAndGetter(): void
|
||||
{
|
||||
$sut = new ProjectRate();
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ use Doctrine\Common\Collections\Collection;
|
||||
*/
|
||||
class ProjectTest extends AbstractEntityTest
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$sut = new Project();
|
||||
self::assertNull($sut->getId());
|
||||
@@ -48,12 +48,12 @@ class ProjectTest extends AbstractEntityTest
|
||||
self::assertTrue($sut->isVisibleAtDate(new \DateTime()));
|
||||
}
|
||||
|
||||
public function testBudgets()
|
||||
public function testBudgets(): void
|
||||
{
|
||||
$this->assertBudget(new Project());
|
||||
}
|
||||
|
||||
public function testSetterAndGetter()
|
||||
public function testSetterAndGetter(): void
|
||||
{
|
||||
$sut = new Project();
|
||||
|
||||
@@ -110,7 +110,7 @@ class ProjectTest extends AbstractEntityTest
|
||||
self::assertFalse($sut->isGlobalActivities());
|
||||
}
|
||||
|
||||
public function testMetaFields()
|
||||
public function testMetaFields(): void
|
||||
{
|
||||
$sut = new Project();
|
||||
$meta = new ProjectMeta();
|
||||
@@ -138,7 +138,7 @@ class ProjectTest extends AbstractEntityTest
|
||||
self::assertCount(2, $sut->getVisibleMetaFields());
|
||||
}
|
||||
|
||||
public function testTeams()
|
||||
public function testTeams(): void
|
||||
{
|
||||
$sut = new Project();
|
||||
$team = new Team('foo');
|
||||
@@ -161,7 +161,7 @@ class ProjectTest extends AbstractEntityTest
|
||||
self::assertCount(0, $team->getProjects());
|
||||
}
|
||||
|
||||
public function testExportAnnotations()
|
||||
public function testExportAnnotations(): void
|
||||
{
|
||||
$sut = new AnnotationExtractor();
|
||||
|
||||
@@ -201,7 +201,7 @@ class ProjectTest extends AbstractEntityTest
|
||||
}
|
||||
}
|
||||
|
||||
public function testClone()
|
||||
public function testClone(): void
|
||||
{
|
||||
$customer = new Customer('prj-customer');
|
||||
$customer->setVatId('DE-0123456789');
|
||||
@@ -241,7 +241,7 @@ class ProjectTest extends AbstractEntityTest
|
||||
self::assertEquals('prj-customer', $clone->getCustomer()->getName());
|
||||
}
|
||||
|
||||
public function testIsVisibleAtDateTime()
|
||||
public function testIsVisibleAtDateTime(): void
|
||||
{
|
||||
$now = new \DateTime();
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class RolePermissionTest extends TestCase
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$sut = new RolePermission();
|
||||
self::assertNull($sut->getId());
|
||||
@@ -27,7 +27,7 @@ class RolePermissionTest extends TestCase
|
||||
self::assertFalse($sut->isAllowed());
|
||||
}
|
||||
|
||||
public function testSetterAndGetter()
|
||||
public function testSetterAndGetter(): void
|
||||
{
|
||||
$sut = new RolePermission();
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class TagTest extends TestCase
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$sut = new Tag();
|
||||
$this->assertNull($sut->getId());
|
||||
@@ -25,7 +25,7 @@ class TagTest extends TestCase
|
||||
$this->assertNull($sut->getColor());
|
||||
}
|
||||
|
||||
public function testSetterAndGetter()
|
||||
public function testSetterAndGetter(): void
|
||||
{
|
||||
$sut = new Tag();
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class TeamTest extends TestCase
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$sut = new Team('foo');
|
||||
self::assertNull($sut->getId());
|
||||
@@ -40,7 +40,7 @@ class TeamTest extends TestCase
|
||||
self::assertEquals(0, $sut->getActivities()->count());
|
||||
}
|
||||
|
||||
public function testColor()
|
||||
public function testColor(): void
|
||||
{
|
||||
$sut = new Team('foo');
|
||||
self::assertNull($sut->getColor());
|
||||
@@ -55,7 +55,7 @@ class TeamTest extends TestCase
|
||||
self::assertTrue($sut->hasColor());
|
||||
}
|
||||
|
||||
public function testTeamMemberships()
|
||||
public function testTeamMemberships(): void
|
||||
{
|
||||
$user = new User();
|
||||
$user2 = new User();
|
||||
@@ -115,7 +115,7 @@ class TeamTest extends TestCase
|
||||
self::assertCount(2, $sut->getMembers());
|
||||
}
|
||||
|
||||
public function testTeamMembershipsException()
|
||||
public function testTeamMembershipsException(): void
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$sut = new Team('foo');
|
||||
@@ -124,7 +124,7 @@ class TeamTest extends TestCase
|
||||
$sut->addMember($member);
|
||||
}
|
||||
|
||||
public function testSetterAndGetter()
|
||||
public function testSetterAndGetter(): void
|
||||
{
|
||||
$sut = new Team('foo-bar');
|
||||
self::assertEquals('foo-bar', $sut->getName());
|
||||
@@ -156,7 +156,7 @@ class TeamTest extends TestCase
|
||||
self::assertCount(2, $sut->getTeamleads());
|
||||
}
|
||||
|
||||
public function testCustomer()
|
||||
public function testCustomer(): void
|
||||
{
|
||||
$customer = new Customer('foo');
|
||||
self::assertEmpty($customer->getTeams());
|
||||
@@ -175,7 +175,7 @@ class TeamTest extends TestCase
|
||||
self::assertEquals(0, $sut->getCustomers()->count());
|
||||
}
|
||||
|
||||
public function testProject()
|
||||
public function testProject(): void
|
||||
{
|
||||
$project = new Project();
|
||||
$project->setName('foo');
|
||||
@@ -195,7 +195,7 @@ class TeamTest extends TestCase
|
||||
self::assertEquals(0, $sut->getProjects()->count());
|
||||
}
|
||||
|
||||
public function testActivities()
|
||||
public function testActivities(): void
|
||||
{
|
||||
$activity = new Activity();
|
||||
$activity->setName('foo');
|
||||
@@ -215,7 +215,7 @@ class TeamTest extends TestCase
|
||||
self::assertEquals(0, $sut->getActivities()->count());
|
||||
}
|
||||
|
||||
public function testUsers()
|
||||
public function testUsers(): void
|
||||
{
|
||||
$user = new User();
|
||||
$user->setAlias('foo');
|
||||
@@ -241,7 +241,7 @@ class TeamTest extends TestCase
|
||||
self::assertCount(1, $sut->getUsers());
|
||||
}
|
||||
|
||||
public function testClone()
|
||||
public function testClone(): void
|
||||
{
|
||||
$c = new Customer('Foo');
|
||||
$p = new Project();
|
||||
|
||||
@@ -30,7 +30,7 @@ class TimesheetMetaTest extends AbstractMetaEntityTest
|
||||
return new TimesheetMeta();
|
||||
}
|
||||
|
||||
public function testSetEntityThrowsException()
|
||||
public function testSetEntityThrowsException(): void
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Expected instanceof Timesheet, received "App\Entity\Project"');
|
||||
|
||||
@@ -44,7 +44,7 @@ class TimesheetValidationTest extends KernelTestCase
|
||||
return $entity;
|
||||
}
|
||||
|
||||
public function testValidationNeedsActivity()
|
||||
public function testValidationNeedsActivity(): void
|
||||
{
|
||||
$project = new Project();
|
||||
$project->setCustomer(new Customer('foo'));
|
||||
@@ -57,7 +57,7 @@ class TimesheetValidationTest extends KernelTestCase
|
||||
$this->assertHasViolationForField($entity, 'activity');
|
||||
}
|
||||
|
||||
public function testValidationNeedsProject()
|
||||
public function testValidationNeedsProject(): void
|
||||
{
|
||||
$entity = new Timesheet();
|
||||
$entity->setUser(new User());
|
||||
@@ -67,7 +67,7 @@ class TimesheetValidationTest extends KernelTestCase
|
||||
$this->assertHasViolationForField($entity, 'project');
|
||||
}
|
||||
|
||||
public function testValidationProjectMismatch()
|
||||
public function testValidationProjectMismatch(): void
|
||||
{
|
||||
$customer = new Customer('foo');
|
||||
$project = (new Project())->setName('foo')->setCustomer($customer);
|
||||
@@ -83,7 +83,7 @@ class TimesheetValidationTest extends KernelTestCase
|
||||
$this->assertHasViolationForField($entity, 'project');
|
||||
}
|
||||
|
||||
public function testValidationCustomerInvisible()
|
||||
public function testValidationCustomerInvisible(): void
|
||||
{
|
||||
$customer = new Customer('foo');
|
||||
$customer->setVisible(false);
|
||||
@@ -124,7 +124,7 @@ class TimesheetValidationTest extends KernelTestCase
|
||||
return $entity;
|
||||
}
|
||||
|
||||
public function testValidationCustomerInvisibleDoesNotTriggerOnStoppedEntities()
|
||||
public function testValidationCustomerInvisibleDoesNotTriggerOnStoppedEntities(): void
|
||||
{
|
||||
$customer = new Customer('foo');
|
||||
$customer->setVisible(false);
|
||||
@@ -140,7 +140,7 @@ class TimesheetValidationTest extends KernelTestCase
|
||||
$this->assertHasNoViolations($entity);
|
||||
}
|
||||
|
||||
public function testValidationCustomerInvisibleDoesTriggerOnNewEntities()
|
||||
public function testValidationCustomerInvisibleDoesTriggerOnNewEntities(): void
|
||||
{
|
||||
$customer = new Customer('foo');
|
||||
$customer->setVisible(false);
|
||||
@@ -156,7 +156,7 @@ class TimesheetValidationTest extends KernelTestCase
|
||||
$this->assertHasViolationForField($entity, 'customer');
|
||||
}
|
||||
|
||||
public function testValidationProjectInvisible()
|
||||
public function testValidationProjectInvisible(): void
|
||||
{
|
||||
$customer = new Customer('foo');
|
||||
$project = (new Project())->setName('foo')->setCustomer($customer)->setVisible(false);
|
||||
@@ -172,7 +172,7 @@ class TimesheetValidationTest extends KernelTestCase
|
||||
$this->assertHasViolationForField($entity, 'project');
|
||||
}
|
||||
|
||||
public function testValidationProjectInvisibleDoesNotTriggerOnStoppedEntities()
|
||||
public function testValidationProjectInvisibleDoesNotTriggerOnStoppedEntities(): void
|
||||
{
|
||||
$customer = new Customer('foo');
|
||||
$project = (new Project())->setName('foo')->setCustomer($customer)->setVisible(false);
|
||||
@@ -183,7 +183,7 @@ class TimesheetValidationTest extends KernelTestCase
|
||||
$this->assertHasNoViolations($entity);
|
||||
}
|
||||
|
||||
public function testValidationProjectInvisibleDoesTriggerOnNewEntities()
|
||||
public function testValidationProjectInvisibleDoesTriggerOnNewEntities(): void
|
||||
{
|
||||
$customer = new Customer('foo');
|
||||
$project = (new Project())->setName('foo')->setCustomer($customer)->setVisible(false);
|
||||
@@ -194,7 +194,7 @@ class TimesheetValidationTest extends KernelTestCase
|
||||
$this->assertHasViolationForField($entity, 'project');
|
||||
}
|
||||
|
||||
public function testValidationActivityInvisible()
|
||||
public function testValidationActivityInvisible(): void
|
||||
{
|
||||
$customer = new Customer('foo');
|
||||
$project = (new Project())->setName('foo')->setCustomer($customer);
|
||||
@@ -210,7 +210,7 @@ class TimesheetValidationTest extends KernelTestCase
|
||||
$this->assertHasViolationForField($entity, 'activity');
|
||||
}
|
||||
|
||||
public function testValidationActivityInvisibleDoesNotTriggerOnStoppedEntities()
|
||||
public function testValidationActivityInvisibleDoesNotTriggerOnStoppedEntities(): void
|
||||
{
|
||||
$customer = new Customer('foo');
|
||||
$project = new Project();
|
||||
@@ -226,7 +226,7 @@ class TimesheetValidationTest extends KernelTestCase
|
||||
$this->assertHasNoViolations($entity);
|
||||
}
|
||||
|
||||
public function testValidationActivityInvisibleDoesTriggerOnNewEntities()
|
||||
public function testValidationActivityInvisibleDoesTriggerOnNewEntities(): void
|
||||
{
|
||||
$customer = new Customer('foo');
|
||||
$project = new Project();
|
||||
@@ -242,7 +242,7 @@ class TimesheetValidationTest extends KernelTestCase
|
||||
$this->assertHasViolationForField($entity, 'activity');
|
||||
}
|
||||
|
||||
public function testValidationEndNotEarlierThanBegin()
|
||||
public function testValidationEndNotEarlierThanBegin(): void
|
||||
{
|
||||
$entity = $this->getEntity();
|
||||
$begin = new \DateTime();
|
||||
|
||||
@@ -20,7 +20,7 @@ use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
||||
*/
|
||||
class UserPreferenceTest extends TestCase
|
||||
{
|
||||
public function testDefaultValues()
|
||||
public function testDefaultValues(): void
|
||||
{
|
||||
$sut = new UserPreference('foo');
|
||||
self::assertTrue($sut->isEnabled());
|
||||
@@ -38,7 +38,7 @@ class UserPreferenceTest extends TestCase
|
||||
self::assertNull($sut->getUser());
|
||||
}
|
||||
|
||||
public function testGetValueChangesReturnTypeOnOtherType()
|
||||
public function testGetValueChangesReturnTypeOnOtherType(): void
|
||||
{
|
||||
$sut = new UserPreference('foo');
|
||||
$sut->setValue('1');
|
||||
@@ -52,7 +52,7 @@ class UserPreferenceTest extends TestCase
|
||||
self::assertFalse($sut->getValue());
|
||||
}
|
||||
|
||||
public function testGetLabelWithLabelOption()
|
||||
public function testGetLabelWithLabelOption(): void
|
||||
{
|
||||
$sut = new UserPreference('foo');
|
||||
self::assertEquals('foo', $sut->getLabel());
|
||||
|
||||
@@ -116,7 +116,7 @@ class UserTest extends TestCase
|
||||
$user->setWorkHoursFriday(7600);
|
||||
$user->setWorkHoursSaturday(7700);
|
||||
$user->setWorkHoursSunday(7800);
|
||||
$user->setHolidaysPerYear(10);
|
||||
$user->setHolidaysPerYear(10.7);
|
||||
self::assertTrue($user->hasWorkHourConfiguration());
|
||||
|
||||
self::assertEquals(7200, $user->getWorkHoursMonday());
|
||||
@@ -126,7 +126,7 @@ class UserTest extends TestCase
|
||||
self::assertEquals(7600, $user->getWorkHoursFriday());
|
||||
self::assertEquals(7700, $user->getWorkHoursSaturday());
|
||||
self::assertEquals(7800, $user->getWorkHoursSunday());
|
||||
self::assertEquals(10, $user->getHolidaysPerYear());
|
||||
self::assertEquals(10.5, $user->getHolidaysPerYear());
|
||||
|
||||
self::assertEquals(7200, $user->getWorkHoursForDay($monday));
|
||||
self::assertEquals(7300, $user->getWorkHoursForDay($tuesday));
|
||||
|
||||
Reference in New Issue
Block a user