@@ -33,17 +33,13 @@ public function testEntityToDto(): void
3333
3434 $ questionDto = QuestionDto::fromEntity ($ entity );
3535
36- self ::assertSame (
37- (new QuestionDto ())
38- ->setSchemaId ('1 ' )
39- ->setType ('type ' )
40- ->setDifficulty (QuestionDifficulty::Easy)
41- ->setTitle ('QuestionTest ' )
42- ->setDescription ('DescriptionTest ' )
43- ->setAnswer ('AnswerTest ' )
44- ->setSolutionVideo ('SolutionVideoTest ' ),
45- $ questionDto ,
46- );
36+ self ::assertSame ('1 ' , $ questionDto ->getSchemaId ());
37+ self ::assertSame ('type ' , $ questionDto ->getType ());
38+ self ::assertSame (QuestionDifficulty::Easy, $ questionDto ->getDifficulty ());
39+ self ::assertSame ('QuestionTest ' , $ questionDto ->getTitle ());
40+ self ::assertSame ('DescriptionTest ' , $ questionDto ->getDescription ());
41+ self ::assertSame ('AnswerTest ' , $ questionDto ->getAnswer ());
42+ self ::assertSame ('SolutionVideoTest ' , $ questionDto ->getSolutionVideo ());
4743 }
4844
4945 /**
@@ -69,16 +65,12 @@ public function testToEntity(): void
6965
7066 $ entity = $ questionDto ->toEntity ($ schemaRepository );
7167
72- self ::assertSame (
73- (new Question ())
74- ->setSchema ((new Schema ())->setId ('1 ' ))
75- ->setType ('type ' )
76- ->setDifficulty (QuestionDifficulty::Easy)
77- ->setTitle ('QuestionTest ' )
78- ->setDescription ('DescriptionTest ' )
79- ->setAnswer ('AnswerTest ' )
80- ->setSolutionVideo ('SolutionVideoTest ' ),
81- $ entity ,
82- );
68+ self ::assertSame ('1 ' , $ entity ->getSchema ()->getId ());
69+ self ::assertSame ('type ' , $ entity ->getType ());
70+ self ::assertSame (QuestionDifficulty::Easy, $ entity ->getDifficulty ());
71+ self ::assertSame ('QuestionTest ' , $ entity ->getTitle ());
72+ self ::assertSame ('DescriptionTest ' , $ entity ->getDescription ());
73+ self ::assertSame ('AnswerTest ' , $ entity ->getAnswer ());
74+ self ::assertSame ('SolutionVideoTest ' , $ entity ->getSolutionVideo ());
8375 }
8476}
0 commit comments