Problem/Motivation

ApcuBackendUnitTest fails in PHP7 because there is no APC available for it yet.

Proposed resolution

GenericCacheBackendUnitTestBase is built on KTB in simpletest which doesn't have an explicit "Skip" functionality like phpunit which would be ideal. Moving to KTBTNG would be fairly disruptive and alex raised the point that there are still several outstanding bugs associated with it.

That leaves us with hard coding skip functionality into the tests. Ugly but it works.

Remaining tasks

User interface changes

n/a

API changes

n/a

Data model changes

n/a

Comments

neclimdul created an issue. See original summary.

neclimdul’s picture

Status: Active » Needs review
StatusFileSize
new4.03 KB

Patch

cilefen’s picture

This is interesting.

catch’s picture

Priority: Normal » Major
catch’s picture

Issue tags: +php7
larowlan’s picture

+++ b/core/modules/system/src/Tests/Cache/ApcuBackendUnitTest.php
@@ -44,4 +54,147 @@ protected function tearDown() {
+    if (!empty($this->getRequirements())) {
+      foreach ($this->getRequirements() as $message) {
+        $this->pass($message);
+      }
+      return;
...
+    if (!empty($this->getRequirements())) {
+      foreach ($this->getRequirements() as $message) {
+        $this->pass($message);
+      }
...
+    if (!empty($this->getRequirements())) {
+      foreach ($this->getRequirements() as $message) {
+        $this->pass($message);
+      }
+      return;
...
+    if (!empty($this->getRequirements())) {
+      foreach ($this->getRequirements() as $message) {
+        $this->pass($message);
+      }
+      return;
...
+    if (!empty($this->getRequirements())) {
+      foreach ($this->getRequirements() as $message) {
+        $this->pass($message);
+      }
+      return;
...
+    if (!empty($this->getRequirements())) {
+      foreach ($this->getRequirements() as $message) {
+        $this->pass($message);
+      }
+      return;
...
+    if (!empty($this->getRequirements())) {
+      foreach ($this->getRequirements() as $message) {
+        $this->pass($message);
+      }
+      return;
...
+    if (!empty($this->getRequirements())) {
+      foreach ($this->getRequirements() as $message) {
+        $this->pass($message);
+      }
+      return;
...
+    if (!empty($this->getRequirements())) {
+      foreach ($this->getRequirements() as $message) {
+        $this->pass($message);
+      }
+      return;
...
+    if (!empty($this->getRequirements())) {
+      foreach ($this->getRequirements() as $message) {
+        $this->pass($message);
+      }
+      return;
...
+    if (!empty($this->getRequirements())) {
+      foreach ($this->getRequirements() as $message) {
+        $this->pass($message);
+      }
+      return;

Can we move this to a protected method and save the duplication?

neclimdul’s picture

StatusFileSize
new3.86 KB
new5.05 KB

Because of the return, we can only save the foreach so I didn't bother but we surely can.

larowlan’s picture

Status: Needs review » Reviewed & tested by the community

Its ugly, but its a necessary evil for now, and documented.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Yep a necessary evil - but harmless given it is tests only. Committed de2e8a9 and pushed to 8.0.x. Thanks!

  • alexpott committed de2e8a9 on 8.0.x
    Issue #2554065 by neclimdul, larowlan: Fix APC test for PHP 7
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.