public function testCreate() { $this->notifier->expects($this->once())->method('notify')->with(NotifierInterface::MESSAGE_CREATE); $this->assertCount(2, $this->findAllTasks()); $task = $this->sut->create('prout', 'bla bla', 'super settings', 0); $this->assertEquals('prout', $task->getName()); $this->assertEquals('bla bla', $task->getJobId()); $this->assertEquals('super settings', $task->getSettings()); $this->assertEquals(0, $task->getPeriod()); $allTasks = $this->findAllTasks(); $this->assertCount(3, $allTasks); $this->assertContains($task, $allTasks); }
public function testCreate() { $notifier = $this->createNotifierMock(); $notifier->expects($this->once())->method('notify')->with(Notifier::MESSAGE_CREATE); $manipulator = new TaskManipulator(self::$DI['app']['EM'], $notifier, self::$DI['app']['translator'], self::$DI['app']['repo.tasks']); $this->assertCount(2, $this->findAllTasks()); $task = $manipulator->create('prout', 'bla bla', 'super settings', 0); $this->assertEquals('prout', $task->getName()); $this->assertEquals('bla bla', $task->getJobId()); $this->assertEquals('super settings', $task->getSettings()); $this->assertEquals(0, $task->getPeriod()); $allTasks = $this->findAllTasks(); $this->assertCount(3, $allTasks); $this->assertContains($task, $allTasks); return $task; }