Quellcode durchsuchen

test(contracts): ensure old phone fields are not present in contract template

alvesantos vor 1 Woche
Ursprung
Commit
1f784c6390
1 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 4 4
      tests/Unit/StudentContractViewTest.php

+ 4 - 4
tests/Unit/StudentContractViewTest.php

@@ -22,14 +22,12 @@ public function test_contract_pdf_view_does_not_contain_old_phone_fields(): void
         
         $student = new Student();
         $student->name = 'Test Student';
-        $student->document_number = '12345678901';
         $student->phone = '11999999999';
         
         $unit = new Unit();
         $unit->fantasy_name = 'Test Unit';
-        $unit->cnpj = '00.000.000/0001-00';
-        $unit->city = (object)['name' => 'Test City'];
-        $unit->state = (object)['code' => 'SP'];
+        $unit->city = clone (object)['name' => 'Test City'];
+        $unit->state = clone (object)['code' => 'SP'];
         
         $packageUnit = new ClassPackageUnit();
         $package = new ClassPackage();
@@ -39,6 +37,8 @@ public function test_contract_pdf_view_does_not_contain_old_phone_fields(): void
         $contract->setRelation('student', $student);
         $contract->setRelation('unit', $unit);
         $contract->setRelation('classPackageUnit', $packageUnit);
+        
+        $contract->setAttribute('installments', 1); // Attribute, not relation
 
         $html = View::make('student-contracts.contract', ['contract' => $contract])->render();