Exemplo n.º 1
0
 public function test_it_creates_new_page()
 {
     $this->RoutesGenerator->shouldReceive('cacheRoutes')->once();
     $this->PageVersionManager->shouldReceive('createDefaultPageVersion')->times(1)->andReturn(new \DvsPageVersion());
     $page = $this->ApiPagesManager->createNewPage(['title' => 'Some page title', 'slug' => '/some-page-title', 'http_verb' => 'get', 'response_path' => 'some.path', 'response_params' => 'param1,param2']);
     assertNotFalse($page);
     assertInstanceOf('DvsPageVersion', $page->version);
     assertEquals($page->title, 'Some page title');
 }
Exemplo n.º 2
0
 public function test_it_creates_new_page_for_spanish_language()
 {
     $this->PageVersionManager->shouldReceive('createDefaultPageVersion')->times(1)->andReturn(new \DvsPageVersion());
     $this->RoutesGenerator->shouldReceive('cacheRoutes')->once();
     $page = $this->PageManager->createNewPage(['title' => 'Some page title', 'slug' => '/some-page-title', 'http_verb' => 'get', 'view' => 'some.view.path', 'language_id' => 163]);
     assertNotFalse($page);
     assertInstanceOf('DvsPageVersion', $page->version);
     assertEquals($page->title, 'Some page title');
     assertEquals($page->route_name, 'es-some-page-title');
 }
 /**
  * @Then I should see the last modified header
  */
 public function iShouldSeeTheLastModifiedHeader()
 {
     $lastModified = $this->getSession()->getResponseHeader('last-modified');
     assertNotNull($lastModified, 'I\'m not able to find the last-modified header!');
     assertNotFalse(DateTime::createFromFormat(DateTime::RFC1123, $lastModified), 'The last-modified header is not a valid RFC 1123 date');
 }
 /**
  * @test(expectedFail=true)
  * @profile(fork)
  */
 public function testAssertNotFalseFailed()
 {
     assertNotFalse(false);
 }