From 24fb66ddf386f247fc47234dacb74ec0d03e35b5 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Thu, 7 Aug 2014 16:04:04 +0200 Subject: [PATCH] remove volatile tests Some tests relying on timings and external network resources were not reliable and occasionally made builds on Travis fail. --- .../Component/Finder/Tests/FinderTest.php | 21 ------------------- .../Stopwatch/Tests/StopwatchEventTest.php | 19 ----------------- .../Stopwatch/Tests/StopwatchTest.php | 13 ------------ 3 files changed, 53 deletions(-) diff --git a/src/Symfony/Component/Finder/Tests/FinderTest.php b/src/Symfony/Component/Finder/Tests/FinderTest.php index 9f9e47b646..da593a7a71 100644 --- a/src/Symfony/Component/Finder/Tests/FinderTest.php +++ b/src/Symfony/Component/Finder/Tests/FinderTest.php @@ -820,25 +820,4 @@ class FinderTest extends Iterator\RealIteratorTestCase $this->assertIterator($expected, $finder); $this->assertIteratorInForeach($expected, $finder); } - - public function testNonSeekableStream() - { - if (!in_array('ftp', stream_get_wrappers())) { - $this->markTestSkipped(sprintf('Unavailable stream "%s".', 'ftp')); - } - - try { - $i = Finder::create()->in('ftp://ftp.mozilla.org/')->depth(0)->getIterator(); - } catch (\UnexpectedValueException $e) { - $this->markTestSkipped(sprintf('Unsupported stream "%s".', 'ftp')); - } - - $contains = array( - 'ftp://ftp.mozilla.org'.DIRECTORY_SEPARATOR.'README', - 'ftp://ftp.mozilla.org'.DIRECTORY_SEPARATOR.'index.html', - 'ftp://ftp.mozilla.org'.DIRECTORY_SEPARATOR.'pub', - ); - - $this->assertIteratorInForeach($contains, $i); - } } diff --git a/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php b/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php index af63153382..825520850a 100644 --- a/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php +++ b/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php @@ -133,25 +133,6 @@ class StopwatchEventTest extends \PHPUnit_Framework_TestCase $this->assertEquals(0, $event->getStartTime(), null, self::DELTA); } - public function testEndTime() - { - $event = new StopwatchEvent(microtime(true) * 1000); - $this->assertEquals(0, $event->getEndTime()); - - $event = new StopwatchEvent(microtime(true) * 1000); - $event->start(); - $this->assertEquals(0, $event->getEndTime()); - - $event = new StopwatchEvent(microtime(true) * 1000); - $event->start(); - usleep(100000); - $event->stop(); - $event->start(); - usleep(100000); - $event->stop(); - $this->assertEquals(200, $event->getEndTime(), null, self::DELTA); - } - /** * @expectedException \InvalidArgumentException */ diff --git a/src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php b/src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php index a8c11424fa..6805effb48 100644 --- a/src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php +++ b/src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php @@ -79,19 +79,6 @@ class StopwatchTest extends \PHPUnit_Framework_TestCase $this->assertEquals(200, $event->getDuration(), null, self::DELTA); } - public function testLap() - { - $stopwatch = new Stopwatch(); - $stopwatch->start('foo', 'cat'); - usleep(100000); - $event = $stopwatch->lap('foo'); - usleep(100000); - $stopwatch->stop('foo'); - - $this->assertInstanceof('Symfony\Component\Stopwatch\StopwatchEvent', $event); - $this->assertEquals(200, $event->getDuration(), null, self::DELTA); - } - /** * @expectedException \LogicException */