diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/GuzzleHarness.php | 3 | ||||
-rw-r--r-- | tests/InstallTest.php | 5 | ||||
-rw-r--r-- | tests/PlanetErrorTest.php | 2 | ||||
-rw-r--r-- | tests/PlanetTest.php | 16 |
4 files changed, 14 insertions, 12 deletions
diff --git a/tests/GuzzleHarness.php b/tests/GuzzleHarness.php index 443235d..7273ba8 100644 --- a/tests/GuzzleHarness.php +++ b/tests/GuzzleHarness.php @@ -16,5 +16,4 @@ class GuzzleHarness extends TestCase 'timeout' => 1, ]); } - -}
\ No newline at end of file +} diff --git a/tests/InstallTest.php b/tests/InstallTest.php index e43f107..fe5dc4e 100644 --- a/tests/InstallTest.php +++ b/tests/InstallTest.php @@ -2,7 +2,8 @@ require_once 'GuzzleHarness.php'; -class InstallTest extends GuzzleHarness { +class InstallTest extends GuzzleHarness +{ public function setUp() : void { @@ -58,4 +59,4 @@ class InstallTest extends GuzzleHarness { $this->assertEquals(200, $res->getStatusCode()); $this->assertStringContainsString('Your moonmoon is ready.', (string) $res->getBody()); } -}
\ No newline at end of file +} diff --git a/tests/PlanetErrorTest.php b/tests/PlanetErrorTest.php index d2f4599..c2570ab 100644 --- a/tests/PlanetErrorTest.php +++ b/tests/PlanetErrorTest.php @@ -9,4 +9,4 @@ class PlanetErrorTest extends TestCase $error = new PlanetError(1, 'foo'); $this->assertEquals('notice: foo', $error->toString()); } -}
\ No newline at end of file +} diff --git a/tests/PlanetTest.php b/tests/PlanetTest.php index 17fdca8..d4b87b8 100644 --- a/tests/PlanetTest.php +++ b/tests/PlanetTest.php @@ -2,16 +2,17 @@ use PHPUnit\Framework\TestCase; -class FoolCategory { +class FoolCategory +{ protected $name; - function __construct($name) + public function __construct($name) { $this->name = $name; } - function get_label() + public function get_label() { return $this->name; } @@ -21,13 +22,15 @@ class FoolItem { protected $categories; - function __construct($categories) + public function __construct($categories) { - foreach ($categories as $c) + foreach ($categories as $c) { $this->categories[] = new FoolCategory($c); + } } - function get_categories() { + public function get_categories() + { return $this->categories; } } @@ -80,5 +83,4 @@ class PlanetTest extends TestCase $this->assertEquals(count($this->planet->_filterItemsByCategory($this->items, 'catA,catB,catC')), 4); $this->assertEquals(count($this->planet->_filterItemsByCategory($this->items, 'catA, catB')), 3); } - } |