Skip to content

Commit

Permalink
Add basic unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
flack committed Dec 14, 2016
1 parent 3d00066 commit 6c1f216
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions test/org/openpsa/notifications/mainTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
/**
* @package openpsa.test
* @author CONTENT CONTROL http://www.contentcontrol-berlin.de/
* @copyright CONTENT CONTROL http://www.contentcontrol-berlin.de/
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
*/

/**
* OpenPSA testcase
*
* @package openpsa.test
*/
class org_openpsa_notifications_mainTest extends openpsa_testcase
{
public function test_notify()
{
$person = $this->create_object('midcom_db_person', array('email' => '[email protected]'));
$person->set_parameter('org.openpsa.notifications', 'net.nehmer.comments:comment_posted', 'email');
$stat = org_openpsa_notifications::notify('net.nehmer.comments:comment_posted', $person->guid, array());
$this->assertTrue($stat);
}

public function test_load_schemadb()
{
$notifications = new org_openpsa_notifications;
$schemadb = $notifications->load_schemadb();

$this->assertArrayHasKey('default', $schemadb);
$this->assertInstanceOf('midcom_helper_datamanager2_schema', $schemadb['default']);
$this->assertArrayHasKey('net_nehmer_comments_comment_posted', $schemadb['default']->fields);
}
}

0 comments on commit 6c1f216

Please sign in to comment.