<?php
use PHPUnit\Framework\TestCase;
class Annotation1Test extends TestCase
{
private static $prop;
/**
* @before
*/
public function beforeTests() : void
{
self::$prop += 2;
}
/**
* @after
*/
public function afterTests() : void
{
// teardown after every test
self::$prop--;
}
/**
* @afterClass
*/
public static function cleanUpTestClass() : void
{
self::$prop = null;
}
/**
* @beforeClass
*/
public static function setUpTestClass() : void
{
self::$prop = 4;
}
public function testIsAwesome() : void
{
$this->assertEquals(6, self::$prop);
}
public function testIsAlsoAwesome() : void
{
$this->assertEquals(7, self::$prop);
}
public function testLastButNotLeast() : void
{
$this->assertEquals(8, self::$prop);
}
}