public function testGetOrderedSteps() { $stepOne = new Step(); $stepOne->setName('step1'); $stepOne->setOrder(1); $stepTwo = new Step(); $stepTwo->setName('step2'); $stepTwo->setOrder(2); $stepThree = new Step(); $stepThree->setName('step3'); $stepThree->setOrder(3); $steps = new ArrayCollection(array($stepTwo, $stepOne, $stepThree)); $stepManager = new StepManager($steps); $ordered = $stepManager->getOrderedSteps(); $this->assertInstanceOf('Doctrine\\Common\\Collections\\ArrayCollection', $ordered); $this->assertSame($stepOne, $ordered->get(0), 'Steps are not in correct order'); $this->assertSame($stepTwo, $ordered->get(1), 'Steps are not in correct order'); $this->assertSame($stepThree, $ordered->get(2), 'Steps are not in correct order'); }