Skip to content
Snippets Groups Projects
Commit cec5d91b authored by CarstenKarbach's avatar CarstenKarbach
Browse files

Add simple test with phpunit

parent 111fff49
No related branches found
No related tags found
No related merge requests found
......@@ -10,8 +10,13 @@
"silex/silex": ">=2.0",
"jards/eventsapiclient": ">=1.0",
"phpmailer/phpmailer": ">=6.0"
},
"require-dev": {
"phpunit/phpunit": "^5.0"
},
"autoload": {
"psr-4": {"jards\\eventsapi\\": "lib/"}
"psr-4": { "jards\\eventsapi\\": "lib/",
"jards\\eventsapi\\tests\\": "tests/"
}
}
}
\ No newline at end of file
This diff is collapsed.
<?php
namespace jards\eventsapi\tests;
use PHPUnit\Framework\TestCase;
use jards\eventsapi\EventManagement;
class EventManagementTest extends TestCase{
public function testGetEvents()
{
echo "testGetEvents\n";
$eventManagement = new EventManagement();
$events = $eventManagement->getEvents();
$content = $events->getContent();
$eventsArray = json_decode($content);
$this->assertTrue(is_array($eventsArray) || is_empty($eventsArray), "Result of event management is not an array." );
}
}
\ No newline at end of file
#!/usr/bin/bash
../vendor/phpunit/phpunit/phpunit ./
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment