BootstrapTest::testSetup()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 34
Code Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 19
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 34
rs 8.8571
1
<?php
2
3
namespace KochTest;
4
5
class BootstrapTest extends \PHPUnit_Framework_TestCase
6
{
7
    public function testSetup()
8
    {
9
        /*
10
         * a) ensure Koch Framework Autoloader is registered in the spl_autoloader_stack
11
         */
12
        $registered_autoloaders = spl_autoload_functions();
0 ignored issues
show
Coding Style introduced by
$registered_autoloaders does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
13
        $this->assertEquals('Koch\Autoload\Loader', $registered_autoloaders[0][0]);
0 ignored issues
show
Coding Style introduced by
$registered_autoloaders does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
14
        $this->assertEquals('autoload', $registered_autoloaders[0][1]);
0 ignored issues
show
Coding Style introduced by
$registered_autoloaders does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
15
16
        /*
17
         * b) ensure Koch Framework Constants are set
18
         */
19
        $this->assertEquals(true, defined('REWRITE_ENGINE_ON'));
20
        $this->assertEquals(true, defined('APPLICATION_PATH'));
21
        $this->assertEquals(true, defined('APPLICATION_CACHE_PATH'));
22
        $this->assertEquals(true, defined('APPLICATION_MODULES_PATH'));
23
        $this->assertEquals(true, defined('VENDOR_PATH'));
24
25
        $this->assertEquals(true, defined('APPLICATION_NAME'));
26
        $this->assertEquals(true, defined('APPLICATION_VERSION'));
27
        $this->assertEquals(true, defined('APPLICATION_VERSION_STATE'));
28
        $this->assertEquals(true, defined('APPLICATION_VERSION_NAME'));
29
        $this->assertEquals(true, defined('APPLICATION_URL'));
30
31
        $this->assertEquals(true, defined('REWRITE_ENGINE_ON'));
32
        $this->assertEquals(true, defined('DEBUG'));
33
34
        /*
35
         *  c) ensure /framework and /tests are found on the include path
36
         */
37
        $includePath = get_include_path();
38
        $this->assertContains(realpath(__DIR__ . '/../../framework'), $includePath);
39
        $this->assertContains(realpath(__DIR__ . '/../../tests'), $includePath);
40
    }
41
}
42