Skip to content

Commit

Permalink
Added some basic tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
DonutsNL committed Nov 15, 2023
1 parent e6d74d4 commit c757e4e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
30 changes: 30 additions & 0 deletions tests/ticketFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion vendor/bin/.phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -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}}
{"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}}

0 comments on commit c757e4e

Please sign in to comment.