Example #1
0
 public function testSetSteps()
 {
     $stepOne = $this->getStepMock('step1');
     $stepTwo = $this->getStepMock('step2');
     $stepManager = new StepManager();
     $stepManager->setSteps(array($stepOne, $stepTwo));
     $steps = $stepManager->getSteps();
     $this->assertInstanceOf('Doctrine\\Common\\Collections\\ArrayCollection', $steps);
     $expected = array('step1' => $stepOne, 'step2' => $stepTwo);
     $this->assertEquals($expected, $steps->toArray());
     $stepsCollection = new ArrayCollection(array('step1' => $stepOne, 'step2' => $stepTwo));
     $stepManager->setSteps($stepsCollection);
     $steps = $stepManager->getSteps();
     $this->assertInstanceOf('Doctrine\\Common\\Collections\\ArrayCollection', $steps);
     $expected = array('step1' => $stepOne, 'step2' => $stepTwo);
     $this->assertEquals($expected, $steps->toArray());
 }