Test Setup Failed
Push — master ( 581479...69dd87 )
by Vasil
02:14
created

ParserTest::canReturnOutwardCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 6
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace VasilDakov\Tests;
4
5
use VasilDakov\Postcode\Postcode;
6
use VasilDakov\Postcode\Parser;
7
8
class ParserTest extends \PHPUnit_Framework_TestCase
9
{
10
    public function setUp()
11
    {
12
        $this->value    = 'AA9A 9AA';
0 ignored issues
show
Bug introduced by
The property value 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...
13
        $this->postcode = new Postcode('AA9A 9AA');
0 ignored issues
show
Bug introduced by
The property postcode 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...
14
    }
15
16
    /**
17
     * @test
18
     * @covers \VasilDakov\Postcode\Parser::outward
19
     */
20
    public function canReturnOutwardCode()
21
    {
22
        $parser = new Parser(new Postcode('AA9A 9AA'));
23
24
        self::assertEquals('AA9A', $parser->outward());
25
    }
26
27
    /**
28
     * @test
29
     * @covers \VasilDakov\Postcode\Parser::inward
30
     */
31
    public function canReturnInwardCode()
32
    {
33
        $parser = new Parser(new Postcode('AA9A 9AA'));
34
35
        self::assertEquals('9AA', $parser->inward());
36
    }
37
}
38