From c757e4e11f1c15394bd7cfbb727c14cd2afc1daa Mon Sep 17 00:00:00 2001 From: DonutsNL Date: Wed, 15 Nov 2023 20:28:24 +0000 Subject: [PATCH] Added some basic tests. --- tests/ticketFilterTest.php | 30 ++++++++++++++++++++++++++++++ vendor/bin/.phpunit.result.cache | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/tests/ticketFilterTest.php b/tests/ticketFilterTest.php index 0dd2ce4..e9d6e51 100644 --- a/tests/ticketFilterTest.php +++ b/tests/ticketFilterTest.php @@ -14,6 +14,36 @@ class ticketFilterTest extends Testcase public function testTicketHandler() { $tf = new TicketHandler(); + + + print("\nEvaluate initHandler exists in TicketHandler::class : "); + if(!$this->assertTrue( + method_exists(TicketHandler::class, 'initHandler'), + 'Class TicketHandler::class does not have method initHandler' + )){ print("Ok!\n"); } + + print("Evaluate getId exists in TicketHandler::class : "); + if(!$this->assertTrue( + method_exists(TicketHandler::class, 'getId'), + 'Class TicketHandler::class does not have method getId' + )){ print("Ok!\n"); } + + print("Evaluate TicketHandler->getId returns interger : "); + if(!$this->assertTrue(is_int($tf->getId(1)), + 'Class TicketHandler::getId(1) did not return integer')){ + print("Ok!\n"); + }; + + print("Evaluate addSolvedMessage exists in TicketHandler::class : "); + if(!$this->assertTrue( + method_exists(TicketHandler::class, 'addSolvedMessage'), + 'Class TicketHandler::class does not have method addSolvedMessage' + )){ print("Ok!\n"); } + + $this->assertTrue( + method_exists(TicketHandler::class, 'addSolvedMessage'), + 'Class TicketHandler::class does not have method addSolvedMessage' + ); } public function testWithoutDelay() diff --git a/vendor/bin/.phpunit.result.cache b/vendor/bin/.phpunit.result.cache index 929f9e0..522ca8e 100644 --- a/vendor/bin/.phpunit.result.cache +++ b/vendor/bin/.phpunit.result.cache @@ -1 +1 @@ -{"version":1,"defects":{"tests\\matchesTest::testWithoutDelay":3,"tests\\ticketFilterTest::testTicketFilter":4,"tests\\ticketFilterTest::testTicketHandler":5},"times":{"tests\\matchesTest::testWithoutDelay":0.005,"tests\\ticketFilterTest::testWithoutDelay":0.001,"tests\\ticketFilterTest::testTicketFilter":0.005,"tests\\ticketFilterTest::testTicketHandler":0.005}} \ No newline at end of file +{"version":1,"defects":{"tests\\matchesTest::testWithoutDelay":3,"tests\\ticketFilterTest::testTicketFilter":4,"tests\\ticketFilterTest::testTicketHandler":4},"times":{"tests\\matchesTest::testWithoutDelay":0.005,"tests\\ticketFilterTest::testWithoutDelay":0,"tests\\ticketFilterTest::testTicketFilter":0.005,"tests\\ticketFilterTest::testTicketHandler":0.006}} \ No newline at end of file