浏览代码

Fix failures

Jordi Boggiano 10 年之前
父节点
当前提交
da881c118b
共有 2 个文件被更改,包括 10 次插入0 次删除
  1. 6 0
      tests/Composer/Test/CacheTest.php
  2. 4 0
      tests/Composer/Test/Util/StreamContextFactoryTest.php

+ 6 - 0
tests/Composer/Test/CacheTest.php

@@ -46,6 +46,9 @@ class CacheTest extends TestCase
 
     public function testRemoveOutdatedFiles()
     {
+        // sleeping a bit to let the filesystem cool down on travis or it has intermittent failures
+        usleep(50000);
+
         $outdated = array_slice($this->files, 1);
         $this->finder
             ->expects($this->once())
@@ -66,6 +69,9 @@ class CacheTest extends TestCase
 
     public function testRemoveFilesWhenCacheIsTooLarge()
     {
+        // sleeping a bit to let the filesystem cool down on travis or it has intermittent failures
+        usleep(50000);
+
         $emptyFinder = $this->getMockBuilder('Symfony\Component\Finder\Finder')->disableOriginalConstructor()->getMock();
         $emptyFinder
             ->expects($this->once())

+ 4 - 0
tests/Composer/Test/Util/StreamContextFactoryTest.php

@@ -154,6 +154,10 @@ class StreamContextFactoryTest extends \PHPUnit_Framework_TestCase
 
     public function testHttpsProxyOverride()
     {
+        if (!extension_loaded('openssl')) {
+            $this->markTestSkipped('Requires openssl');
+        }
+
         $_SERVER['http_proxy'] = 'http://username:password@proxyserver.net';
         $_SERVER['https_proxy'] = 'https://woopproxy.net';