Пример #1
0
 public function testCRUD()
 {
     $log = $this->subject->create();
     $log->setChannel('Channel');
     $log->setLevel(200);
     $log->setLevelName('info');
     $log->setMessage('Message');
     $log->setDatetime(new \DateTime());
     $log->setContext(['context' => 'Context']);
     $log->setExtra(['extra' => 'Extra']);
     $this->subject->save($log);
     $this->getEntityManager()->clear();
     /** @var Log[] $logs */
     $logs = $this->subject->findAll();
     /** @var Log $log */
     $log = $logs[0];
     $this->assertCount(1, $logs);
     $this->assertEquals($log, $logs[0]);
     $this->subject->delete($log);
     $this->getEntityManager()->clear();
     $this->assertEmpty($this->subject->findAll());
 }
Пример #2
0
 public function testFindAll()
 {
     $this->repository->expects($this->once())->method('findAll');
     $this->subject->findAll();
 }