From 3cae2765cbf81ec3da842d9022388a38975c9396 Mon Sep 17 00:00:00 2001 From: Andrey Savchenko Date: Thu, 22 Feb 2018 18:19:34 +0200 Subject: [PATCH] =?UTF-8?q?Fixed=20stopwatch=20record=20duration=20test=20?= =?UTF-8?q?that=20didn=E2=80=99t=20test=20properly.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/Record/StopwatchTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Record/StopwatchTest.php b/tests/Record/StopwatchTest.php index c5dd742..f8c6086 100644 --- a/tests/Record/StopwatchTest.php +++ b/tests/Record/StopwatchTest.php @@ -19,6 +19,7 @@ class StopwatchTest extends LapsTestCase { $collector->start( 'Event', 'info' ); $collector->start( 'Not stopped', 'info' ); + usleep( 1000 ); $event = $collector->stop( 'Event' ); $this->assertFalse( $collector->stop( 'Not event' ) ); @@ -45,7 +46,7 @@ class StopwatchTest extends LapsTestCase { $this->assertEquals( 'Event', $record->get_name() ); $this->assertEquals( 'info', $record->get_category() ); $this->assertEquals( $event->getOrigin() / 1000, $record->get_origin() ); - $this->assertEquals( $event->getDuration(), $record->get_duration() ); + $this->assertEquals( $event->getDuration() / 1000, $record->get_duration() ); $this->assertContains( 'Event', $record->get_description() ); } }