[Stopwatch] Fixed phpdoc for category name

This commit is contained in:
Samuel NELA 2018-12-25 01:54:22 +01:00
parent 44e9a91f30
commit 7f46dfb1c4
2 changed files with 10 additions and 2 deletions

View File

@ -96,8 +96,8 @@ class Stopwatch
/**
* Starts an event.
*
* @param string $name The event name
* @param string $category The event category
* @param string $name The event name
* @param string|null $category The event category
*
* @return StopwatchEvent
*/

View File

@ -35,6 +35,14 @@ class StopwatchTest extends TestCase
$this->assertSame($event, $stopwatch->getEvent('foo'));
}
public function testStartWithoutCategory()
{
$stopwatch = new Stopwatch();
$stopwatchEvent = $stopwatch->start('bar');
$this->assertSame('default', $stopwatchEvent->getCategory());
$this->assertSame($stopwatchEvent, $stopwatch->getEvent('bar'));
}
public function testIsStarted()
{
$stopwatch = new Stopwatch();