Completed
Pull Request — master (#133)
by Simone
02:02
created

RulerTest::test()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 26
Code Lines 15

Duplication

Lines 26
Ratio 100 %

Importance

Changes 0
Metric Value
dl 26
loc 26
c 0
b 0
f 0
rs 8.8571
cc 1
eloc 15
nc 1
nop 0
1
<?php
2
3
/**
4
 * This file is part of sensorario/resources repository
5
 *
6
 * (c) Simone Gentili <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sensorario\Resources\Test\Resources;
13
14
use PHPUnit\Framework\TestCase;
15
use Sensorario\Resources\Configurator;
16
use Sensorario\Resources\Container;
17
use Sensorario\Resources\Resource;
18
use Sensorario\Resources\Rulers\Ruler;
19
20
class RulerTest extends TestCase
21
{
22
    /**
23
     * @expectedException \Sensorario\Resources\Exceptions\UndefinedResourceException
24
     * @expectedExceptionMessage Oops! Cant get rule without resource
25
     */
26
    public function testCantGetRuleWithoutRecource()
27
    {
28
        $this->ruler = new Ruler();
0 ignored issues
show
Bug introduced by
The property ruler does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
29
        $this->ruler->getRuleFromResource();
30
    }
31
}
32