Example #1
0
 /**
  * Test that isEmpty() returns TRUE if there are no
  * messages and FALSE if there.
  *
  * @covers  \Hubzero\Notification\Handler::isEmpty
  * @return  void
  **/
 public function testIsEmpty()
 {
     $handler = new Handler(new Memory());
     $this->assertTrue($handler->isEmpty());
     $handler->error('Lorem ipsum dol.');
     $this->assertFalse($handler->isEmpty());
 }
Example #2
0
 /**
  * Test that messages added with error() are
  * assigned the appropriate type.
  *
  * @return  void
  **/
 public function testError()
 {
     $handler = new Handler(new Memory());
     $handler->error('Lorem ipsum dol.');
     $m = $handler->messages();
     $message = array_pop($m);
     $this->assertTrue(is_array($message), 'Individual messages should be of type array');
     $this->assertEquals($message['type'], 'error');
 }