File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -107,4 +107,15 @@ public function testPopulationCrossoverWithUnequalStrings()
107107 $ this ->assertEquals ('AFCHIJK ' , $ population ->getIndividuals ()[2 ]->getObject ()->getText ());
108108 $ this ->assertEquals (3 , $ population ->getIndividualCount ());
109109 }
110+
111+ public function testCopyIndividual ()
112+ {
113+ $ population = new TextPopulation ();
114+ $ population ->addIndividual (TextIndividual::generateFromString ('ABCD ' ));
115+ $ population ->copyIndividual ();
116+ $ this ->assertEquals (2 , $ population ->getIndividualCount ());
117+ $ individuals = $ population ->getIndividuals ();
118+ $ this ->assertEquals ('ABCD ' , $ individuals [0 ]->getObject ()->getText ());
119+ $ this ->assertEquals ('ABCD ' , $ individuals [1 ]->getObject ()->getText ());
120+ }
110121}
You can’t perform that action at this time.
0 commit comments