for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Particletree\Pqp\Console;
use Particletree\Pqp\PhpQuickProfiler;
class PhpQuickProfilerTest extends PHPUnit_Framework_TestCase
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
public function __construct()
}
public function testConstruct()
$console = new Console();
$startTime = microtime(true);
$profiler = new PhpQuickProfiler($console, $startTime);
$this->assertAttributeSame($console, 'console', $profiler);
$this->assertAttributeEquals($startTime, 'startTime', $profiler);
public function testGetReadableTime()
$test_input = array(
'.032432' => '32.432 ms',
'24.3781' => '24.378 s',
'145.123' => '2.419 m'
);
foreach ($test_input as $input => $expected_return) {
$this->assertEquals($expected_return, PhpQuickProfiler::getReadableTime($input));
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.