/** * Test * * @return void * */ public function testClear() { $el = new \Hivefive\CFlasher\CFlasher(); $_SESSION['flash'] = "test"; $res = $el->clearFlash(); $exp = true; $this->assertEquals($res, $exp, "Clearing the session failed"); }
<?php // // Set the error reporting. // error_reporting(-1); // Report all type of errors ini_set('display_errors', 1); // Display all errors ini_set('output_buffering', 0); // Do not buffer outputs, write directly //include the autoloader to make test.php work require '../../../autoload.php'; // // Set up the test environment // $flasher = new \Hivefive\CFlasher\CFlasher(); $flasher->setMessage('info'); $flash = $flasher->getMessage(); ?> <body> <div style="max-width:500px; margin:0 auto;" class="<?php echo $flash['type']; ?> "> <?php echo $flash['message']; ?> </div> </body> </html>