Example #1
0
 /**
  * Test for method RenderTimestampAsTable
  */
 public function testRenderTimestampAsTableSuccess()
 {
     $Vlog = new \Toeswade\Log\Vlog();
     // Create log for test
     $Clog = new \Toeswade\Log\Clog();
     $class = 'Test Class';
     $method = 'Test Method';
     $comment = 'Test Comment';
     $Clog->stamp($class, $method, $comment);
     // Get log and render it
     $timestamps = $Clog->getLogAsArray();
     $res = $Vlog->renderTimestampAsTable($timestamps, 1, 2);
     $this->assertInternalType('string', $res);
 }
Example #2
0
<?php 
/*
 * index.php
 * Simple code example to show how Clog can work. Also see src/Test/Test.php to see where the timestamps are made.
 */
//MAKE SURE ERRORS ARE SHOWN... MIGHT WANT TO TURN THIS OFF ON A PUBLIC SERVER
error_reporting(E_ALL);
ini_set('display_errors', 'On');
require_once '../autoloader.php';
$Clog = new Toeswade\Log\Clog();
$testLogger = new Toeswade\Test\Test(4, 2, $Clog);
$test1 = $testLogger->test1();
$test2 = $testLogger->test2();
$log = $Clog->renderLog();
?>

<!doctype html>
<html>
<head>
<meta charset=utf8>
<title>Simple Clog example</title>
</head>
<body>
<h1>Clog is up and running</h1>
<p><?php 
echo $test1;
?>
</p>
<p><?php 
echo $test2;
Example #3
0
 /**
  * Test that we always get a stirng as return value
  *
  * @return void
  *
  */
 public function testRenderLogFail()
 {
     $Clog = new \Toeswade\Log\Clog();
     $res = $Clog->renderLog();
     $this->assertInternalType('string', $res);
 }