SubdomainRouteTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 1
cbo 3
dl 0
loc 51
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 6 1
A tearDown() 0 4 1
A testParse() 0 10 1
A testMatch() 0 10 1
1
<?php
2
/**
3
 * CakePHP Plugin : CakePHP Subdomain Routing
4
 * Copyright (c) Multidimension.al (http://multidimension.al)
5
 * Github : https://github.com/multidimension-al/cakephp-subdomains
6
 *
7
 * Licensed under The MIT License
8
 * For full copyright and license information, please see the LICENSE file
9
 * Redistributions of files must retain the above copyright notice.
10
 *
11
 * @copyright (c) Multidimension.al (http://multidimension.al)
12
 * @link      https://github.com/multidimension-al/cakephp-subdomains Github
13
 * @license   http://www.opensource.org/licenses/mit-license.php MIT License
14
 */
15
16
namespace Multidimensional\Subdomains\Tests\TestCase\Routing\Route;
17
18
use Cake\Core\Configure;
19
use Cake\Network\Request;
20
use Cake\Routing\Router;
21
use Cake\Routing\Route\Route;
22
use Cake\TestSuite\TestCase;
23
use Multidimensional\Subdomains\Middleware\SubdomainMiddleware;
24
use Multidimensional\Subdomains\Routing\Route\SubdomainRoute;
25
26
class SubdomainRouteTest extends TestCase
27
{
28
29
    private $subdomainRoute;
30
31
    /**
32
     * @return void
33
     */
34
    public function setUp()
35
    {
36
        parent::setUp();
37
        Configure::write('Multidimensional/Subdomains.Subdomains', ['admin']);
38
        $this->subdomainRoute = new SubdomainRoute();
0 ignored issues
show
Bug introduced by
The call to SubdomainRoute::__construct() misses a required argument $template.

This check looks for function calls that miss required arguments.

Loading history...
39
    }
40
41
    /**
42
     * @return void
43
     */
44
    public function tearDown()
45
    {
46
        unset($this->subdomainRoute);
47
    }
48
49
    /**
50
     * @return void
51
     */
52
    public function testParse()
53
    {
54
        $this->markTestIncomplete('Not implemented yet.');
55
        /*$url = ['prefix' => 'admin', 'Controller' => 'pages', 'action' => 'index'];
0 ignored issues
show
Unused Code Comprehensibility introduced by
55% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
56
        $response = $this->subdomainRoute->parse($url, '');
57
        //assertSame
58
        $url = ['prefix' => 'users', 'Controller' => 'pages', 'action' => 'index'];
59
        $response = $this->subdomainRoute->parse($url, '');
60
        //assertwrong*/
61
    }
62
63
    /**
64
     * @return void
65
     */
66
    public function testMatch()
67
    {
68
        $this->markTestIncomplete('Not implemented yet.');
69
        /*$url = ['prefix' => 'admin', 'Controller' => 'pages', 'action' => 'index'];
0 ignored issues
show
Unused Code Comprehensibility introduced by
55% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
70
        $response = $this->subdomainRoute->match($url, '');
71
        //assertSame
72
        $url = ['prefix' => 'users', 'Controller' => 'pages', 'action' => 'index'];
73
        $response = $this->subdomainRoute->match($url, '');
74
        //assertwrong*/
75
    }
76
}
77