From 8c9bfae7f7a25fa2d831d0a3991401634a9441f5 Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Sun, 23 Feb 2020 21:30:19 +0100 Subject: [PATCH] Use pcov for code coverage --- .travis.yml | 2 ++ tests/DeferredTest.php | 18 +++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index ddac7a86..096dfdaa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,8 @@ matrix: - php: nightly install: + - phpenv config-rm xdebug.ini + - pecl install pcov - composer install script: diff --git a/tests/DeferredTest.php b/tests/DeferredTest.php index 861dd576..8e731345 100644 --- a/tests/DeferredTest.php +++ b/tests/DeferredTest.php @@ -23,9 +23,9 @@ public function getPromiseTestAdapter(callable $canceller = null) /** @test */ public function shouldRejectWithoutCreatingGarbageCyclesIfCancellerRejectsWithException() { - if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) { - $this->markTestSkipped('This test has memory leaks when code coverage is collected'); - } +// if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) { +// $this->markTestSkipped('This test has memory leaks when code coverage is collected'); +// } gc_collect_cycles(); $deferred = new Deferred(function ($resolve, $reject) { @@ -40,9 +40,9 @@ public function shouldRejectWithoutCreatingGarbageCyclesIfCancellerRejectsWithEx /** @test */ public function shouldRejectWithoutCreatingGarbageCyclesIfParentCancellerRejectsWithException() { - if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) { - $this->markTestSkipped('This test has memory leaks when code coverage is collected'); - } +// if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) { +// $this->markTestSkipped('This test has memory leaks when code coverage is collected'); +// } gc_collect_cycles(); $deferred = new Deferred(function ($resolve, $reject) { @@ -57,9 +57,9 @@ public function shouldRejectWithoutCreatingGarbageCyclesIfParentCancellerRejects /** @test */ public function shouldRejectWithoutCreatingGarbageCyclesIfCancellerHoldsReferenceAndExplicitlyRejectWithException() { - if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) { - $this->markTestSkipped('This test has memory leaks when code coverage is collected'); - } +// if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) { +// $this->markTestSkipped('This test has memory leaks when code coverage is collected'); +// } gc_collect_cycles(); $deferred = new Deferred(function () use (&$deferred) { });