/** * Test cannot delete used status */ public function testDeleteAction() { $this->markTestSkipped('To reactivate when API roles will be implemented'); $status = $this->statusRepository->findOneByInitial(); $this->client->request('DELETE', '/api/status/' . $status->getId() . '/delete'); $this->assertSame(403, $this->client->getResponse()->getStatusCode()); $this->assertContains('open_orchestra_api.status.delete_not_granted', $this->client->getResponse()->getContent()); }
/** * @param string $name * @param bool $currentlyPublished * * @dataProvider provideStatusName */ public function testChangeContentStatus($name, $currentlyPublished) { $this->markTestSkipped('To reactivate when API roles will be implemented'); $content = $this->contentRepository->findOneByLanguageAndVersion('206_3_portes', 'fr', 2); $newStatus = $this->statusRepository->findOneByName($name); $newStatusId = $newStatus->getId(); $this->client->request('POST', '/api/content/' . $content->getId() . '/update', array(), array(), array(), json_encode(array('status_id' => $newStatusId))); $this->assertSame(200, $this->client->getResponse()->getStatusCode()); $newcontent = $this->contentRepository->findOneByLanguageAndVersion('206_3_portes', 'fr', 2); $this->assertEquals($currentlyPublished, $newcontent->isCurrentlyPublished()); }
/** * @param string $name * @param int $publishedVersion * * @dataProvider provideStatusNameAndPublishedVersion */ public function testChangeNodeStatus($name, $publishedVersion) { $this->markTestSkipped('To reactivate when API roles will be implemented'); $node = $this->nodeRepository->findInLastVersion('root', 'fr', '2'); $newStatus = $this->statusRepository->findOneByName($name); $newStatusId = $newStatus->getId(); $this->client->request('POST', '/api/node/' . $node->getId() . '/update', array(), array(), array(), json_encode(array('status_id' => $newStatusId))); $this->assertSame(200, $this->client->getResponse()->getStatusCode()); $newNode = $this->nodeRepository->findOneCurrentlyPublished('root', 'fr', '2'); $this->assertEquals($publishedVersion, $newNode->getVersion()); }