public function testGetNextValueWithNotExistingSequenceReturnsNextValue() { $sequenceName = 'ABC'; $this->repository->expects($this->once())->method('findOneBy')->with(array('name' => $sequenceName))->willReturn(null); $this->objectManager->expects($this->any())->method('persist'); $this->objectManager->expects($this->any())->method('flush'); $result = $this->subject->getNextValue($sequenceName); $this->assertEquals(1, $result); }
/** * @param EntityManager $em * @param string $class */ public function __construct(EntityManager $em, $class) { parent::__construct($em, $class); $this->em = $em; }