public function testUpdateKey()
 {
     $this->markTestIncomplete('Broken');
     $templates = $this->repository->findAll();
     $this->assertTrue(empty($templates));
     $template = $this->repository->getTemplate('new/template');
     $id = $template->getId();
     $this->repository->updateKey('new/template', 'newtemplate');
     $template = $this->repository->findOneBy(array('key' => 'newtemplate'));
     $this->assertNotEmpty($template);
     $this->assertEquals($id, $template->getId());
 }
Example #2
0
 public function testStoreMetadata()
 {
     $template = $this->getMockBuilder('Newscoop\\Entity\\Template')->disableOriginalConstructor()->getMock();
     $this->repository->expects($this->once())->method('getTemplate')->with('key')->will($this->returnValue($template));
     $this->repository->expects($this->once())->method('save')->with($this->equalTo($template), array('cache_lifetime' => 5));
     $this->service->storeMetadata('key', array('cache_lifetime' => 5));
 }
 private function flushAssertTrue()
 {
     $this->em->flush();
     $this->assertTrue($this->repository->isUsed($this->template->getKey()));
 }