Completed
Push — master ( 0708d4...99f0e4 )
by Rafał
02:36
created

BridgeTest::tearDownAfterClass()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * This file is part of the Superdesk Web Publisher Bridge Bundle.
5
 *
6
 * Copyright 2016 Sourcefabric z.u. and contributors.
7
 *
8
 * For the full copyright and license information, please see the
9
 * AUTHORS and LICENSE files distributed with this source code.
10
 *
11
 * @copyright 2016 Sourcefabric z.ú.
12
 * @license http://www.superdesk.org/license
13
 */
14
namespace SWP\Bundle\BridgeBundle\Tests\Functional;
15
16
class BridgeTest extends WebTestCase
17
{
18
    const TEST_CASE_NAME = 'Bridge';
19
20
    /**
21
     * @expectedException \Superdesk\ContentApiSdk\Exception\ContentApiException
22
     * @dataProvider getConfigs
23
     */
24
    public function testIndexForCallToInvalidEndpoints($config)
25
    {
26
        $client = $this->createClient(array('test_case' => self::TEST_CASE_NAME, 'root_config' => $config));
27
28
        $client->request('GET', '/bridge/invalid_endpoint/');
29
    }
30
31
    public function getConfigs()
32
    {
33
        return array(
34
            array('config.yml'),
35
        );
36
    }
37
38
    public static function setUpBeforeClass()
39
    {
40
        parent::deleteTmpDir(self::TEST_CASE_NAME);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (deleteTmpDir() instead of setUpBeforeClass()). Are you sure this is correct? If so, you might want to change this to $this->deleteTmpDir().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
41
    }
42
43
    public static function tearDownAfterClass()
44
    {
45
        parent::deleteTmpDir(self::TEST_CASE_NAME);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (deleteTmpDir() instead of tearDownAfterClass()). Are you sure this is correct? If so, you might want to change this to $this->deleteTmpDir().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
46
    }
47
}
48