contract = new Contract(); } /** * @covers Modules\ContractManagement\Models\Contract * @group module */ public function testDefault() : void { self::assertEquals(0, $this->contract->getId()); self::assertEquals([], $this->contract->getFiles()); } /** * @covers Modules\ContractManagement\Models\Contract * @group module */ public function testMediaInputOutput() : void { $this->contract->addFile(new Media()); self::assertCount(1, $this->contract->getFiles()); } /** * @covers Modules\ContractManagement\Models\Contract * @group module */ public function testSerialize() : void { $this->contract->title = 'Title'; $this->contract->description = 'Description'; $this->contract->duration = 123; $this->contract->warning = 2; $serialized = $this->contract->jsonSerialize(); unset($serialized['createdAt']); self::assertEquals( [ 'id' => 0, 'title' => 'Title', 'description' => 'Description', 'start' => null, 'end' => null, 'duration' => 123, 'warning' => 2, 'responsible' => null, 'costs' => null, 'type' => new ContractType(), ], $serialized ); } }