CrudAuthorizeExtensionTest::testDefault()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Copyright 2016 - 2018, Cake Development Corporation (http://cakedc.com)
4
 *
5
 * Licensed under The MIT License
6
 * Redistributions of files must retain the above copyright notice.
7
 *
8
 * @copyright Copyright 2016 - 2018, Cake Development Corporation (http://cakedc.com)
9
 * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
10
 */
11
12
namespace CakeDC\Api\Test\TestCase\Integration\Service\Action\Extension;
13
14
use CakeDC\Api\TestSuite\IntegrationTestCase;
15
use CakeDC\Api\Test\ConfigTrait;
16
use CakeDC\Api\Test\FixturesTrait;
17
use CakeDC\Api\Test\Settings;
18
use Cake\Core\Configure;
19
use Cake\Utility\Hash;
20
21
class CrudAuthorizeExtensionTest extends IntegrationTestCase
22
{
23
24
    use ConfigTrait;
25
    use FixturesTrait;
26
27
    /**
28
     * setUp
29
     *
30
     * @return void
31
     */
32
    public function setUp()
33
    {
34
        parent::setUp();
35
        Configure::write('App.fullBaseUrl', 'http://example.com');
36
        $this->_tokenAccess();
37
        $this->_loadDefaultExtensions([]);
38
        // setup permissions in test actions
39
        $this->getDefaultUser(Settings::USER1);
40
    }
41
42
    /**
43
     * tearDown
44
     *
45
     * @return void
46
     */
47
    public function tearDown()
48
    {
49
        parent::tearDown();
50
    }
51
52
    public function testDefault()
53
    {
54
        $this->sendRequest('/articles', 'GET');
55
        $result = $this->getJsonResponse();
56
        // $expected = [];
57
        $this->assertSuccess($result);
58
        // $this->assertEquals($expected, $result);
59
    }
60
}
61