public function testCreate() { $email = new Email(); $this->objectManagerMock->shouldReceive('persist')->once()->with($email)->andReturn(true); $this->objectManagerMock->shouldReceive('flush')->once(); $this->emailManager->create($email); }