for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace VasilDakov\Tests;
use VasilDakov\Postcode\Postcode;
use VasilDakov\Postcode\Parser;
class ParserTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
$this->value = 'AA9A 9AA';
value
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;
$this->postcode = new Postcode('AA9A 9AA');
postcode
}
/**
* @test
* @covers \VasilDakov\Postcode\Parser::outward
*/
public function canReturnOutwardCode()
$parser = new Parser(new Postcode('AA9A 9AA'));
self::assertEquals('AA9A', $parser->outward());
* @covers \VasilDakov\Postcode\Parser::inward
public function canReturnInwardCode()
self::assertEquals('9AA', $parser->inward());
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: