for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace ParityBit\DeploymentNotifier;
class DeploymentTest extends \PHPUnit_Framework_TestCase
{
protected $faker;
protected $previousVersion;
protected $currentVersion;
protected $environment;
protected $server;
public function setUp()
$this->faker = \Faker\Factory::create();
$this->previousVersion = new Version($this->faker->word);
$this->currentVersion = new Version($this->faker->word);
$this->environment = new Environment($this->faker->word);
$this->server = new Server($this->faker->word);
$this->deployment = new Deployment(
deployment
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->environment,
$this->previousVersion,
$this->currentVersion,
$this->server
);
}
public function testGetEnvironment()
$this->assertEquals(
$this->deployment->getEnvironment()
public function testGetPreviousVersion()
$this->deployment->getPreviousVersion()
public function testGetCurrentVersion()
$this->deployment->getCurrentVersion()
public function testGetServer()
$this->server,
$this->deployment->getServer()
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: