Completed
Push — add_functional_test ( 065c97...673558 )
by amaury
02:46
created

StatusControllerTest::testDeleteAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 11
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
3
namespace OpenOrchestra\FunctionalTests\WorkflowAdminBundle\Controller;
4
5
use OpenOrchestra\FunctionalTests\Utils\AbstractAuthenticatedTest;
6
use OpenOrchestra\ModelInterface\Repository\StatusRepositoryInterface;
7
8
/**
9
 * Class StatusControllerTest
10
 */
11
class StatusControllerTest extends AbstractAuthenticatedTest
12
{
13
    /**
14
     * @var StatusRepositoryInterface
15
     */
16
    protected $statusRepository;
17
18
    /**
19
     * Set up the test
20
     */
21
    public function setUp()
22
    {
23
        parent::setUp();
24
        $this->statusRepository = static::$kernel->getContainer()->get('open_orchestra_model.repository.status');
25
    }
26
27
    /**
28
     * Test cannot delete used status
29
     */
30
    public function testDeleteAction()
31
    {
32
        $this->markTestSkipped('To reactivate when API roles will be implemented');
33
34
        $status = $this->statusRepository->findOneByInitial();
35
36
        $this->client->request('DELETE', '/api/status/' . $status->getId() . '/delete');
37
38
        $this->assertSame(403, $this->client->getResponse()->getStatusCode());
39
        $this->assertContains('open_orchestra_api.status.delete_not_granted', $this->client->getResponse()->getContent());
40
    }
41
}
42