Skip to content

Commit

Permalink
Rename Php7 to Php8 in all test files (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrove-oss authored Jan 29, 2024
1 parent 23d6a55 commit eade493
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner

@RunWith(classOf[JUnitRunner])
class Php81ActionContainerTests extends Php7ActionContainerTests {
class Php81ActionContainerTests extends Php8ActionContainerTests {

override lazy val phpContainerImageName = "action-php-v8.1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner

@RunWith(classOf[JUnitRunner])
class Php82ActionContainerTests extends Php7ActionContainerTests {
class Php82ActionContainerTests extends Php8ActionContainerTests {

override lazy val phpContainerImageName = "action-php-v8.2"
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner

@RunWith(classOf[JUnitRunner])
class Php83ActionContainerTests extends Php7ActionContainerTests {
class Php83ActionContainerTests extends Php8ActionContainerTests {

override lazy val phpContainerImageName = "action-php-v8.3"
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import spray.json._
import spray.json.DefaultJsonProtocol._

@RunWith(classOf[JUnitRunner])
abstract class Php7ActionContainerTests extends BasicActionRunnerTests with WskActorSystem {
abstract class Php8ActionContainerTests extends BasicActionRunnerTests with WskActorSystem {
// note: "out" will not be empty as the PHP web server outputs a message when it starts up
val enforceEmptyOutputStream = false

Expand All @@ -37,7 +37,7 @@ abstract class Php7ActionContainerTests extends BasicActionRunnerTests with WskA
withContainer(phpContainerImageName, env)(code)
}

def withPhp7Container(code: ActionContainer => Unit) = withActionContainer()(code)
def withPhp8Container(code: ActionContainer => Unit) = withActionContainer()(code)

behavior of phpContainerImageName

Expand Down Expand Up @@ -132,7 +132,7 @@ abstract class Php7ActionContainerTests extends BasicActionRunnerTests with WskA
}

it should "return some error on action error" in {
val (out, err) = withPhp7Container { c =>
val (out, err) = withPhp8Container { c =>
val code =
"""
|<?php
Expand Down Expand Up @@ -220,7 +220,7 @@ abstract class Php7ActionContainerTests extends BasicActionRunnerTests with WskA
}

it should "support application errors" in {
withPhp7Container { c =>
withPhp8Container { c =>
val code =
"""
|<?php
Expand All @@ -242,7 +242,7 @@ abstract class Php7ActionContainerTests extends BasicActionRunnerTests with WskA
}

it should "fail gracefully when an action has a fatal error" in {
val (out, err) = withPhp7Container { c =>
val (out, err) = withPhp8Container { c =>
val code =
"""
| <?php
Expand Down Expand Up @@ -272,7 +272,7 @@ abstract class Php7ActionContainerTests extends BasicActionRunnerTests with WskA
}

it should "support returning a stdClass" in {
val (out, err) = withPhp7Container { c =>
val (out, err) = withPhp8Container { c =>
val code =
"""
| <?php
Expand All @@ -296,7 +296,7 @@ abstract class Php7ActionContainerTests extends BasicActionRunnerTests with WskA
}

it should "support returning an object with a getArrayCopy() method" in {
val (out, err) = withPhp7Container { c =>
val (out, err) = withPhp8Container { c =>
val code =
"""
| <?php
Expand All @@ -320,7 +320,7 @@ abstract class Php7ActionContainerTests extends BasicActionRunnerTests with WskA
}

it should "support the documentation examples (1)" in {
val (out, err) = withPhp7Container { c =>
val (out, err) = withPhp8Container { c =>
val code =
"""
| <?php
Expand Down Expand Up @@ -354,7 +354,7 @@ abstract class Php7ActionContainerTests extends BasicActionRunnerTests with WskA

it should "have Guzzle and Uuid packages available" in {
// GIVEN that it should "error when requiring a non-existent package" (see test above for this)
val (out, err) = withPhp7Container { c =>
val (out, err) = withPhp8Container { c =>
val code =
"""
| <?php
Expand Down Expand Up @@ -397,7 +397,7 @@ abstract class Php7ActionContainerTests extends BasicActionRunnerTests with WskA
// Lest someone should make it too easy.
code.length should be >= 500000

val (out, err) = withPhp7Container { c =>
val (out, err) = withPhp8Container { c =>
c.init(initPayload(code))._1 should be(200)

val (runCode, runRes) = c.run(runPayload(JsObject()))
Expand Down Expand Up @@ -431,7 +431,7 @@ abstract class Php7ActionContainerTests extends BasicActionRunnerTests with WskA

val code = ZipBuilder.mkBase64Zip(srcs)

val (out, err) = withPhp7Container { c =>
val (out, err) = withPhp8Container { c =>
c.init(initPayload(code))._1 should be(200)

val (runCode, runRes) = c.run(runPayload(JsObject()))
Expand All @@ -456,7 +456,7 @@ abstract class Php7ActionContainerTests extends BasicActionRunnerTests with WskA

val code = ZipBuilder.mkBase64Zip(srcs)

val (out, err) = withPhp7Container { c =>
val (out, err) = withPhp8Container { c =>
c.init(initPayload(code))._1 should be(200)

val (runCode, runRes) = c.run(runPayload(JsObject()))
Expand All @@ -479,7 +479,7 @@ abstract class Php7ActionContainerTests extends BasicActionRunnerTests with WskA

val code = ZipBuilder.mkBase64Zip(srcs)

withPhp7Container { c =>
withPhp8Container { c =>
c.init(initPayload(code, main = "niam"))._1 should be(200)

val (runCode, runRes) = c.run(runPayload(JsObject()))
Expand All @@ -501,7 +501,7 @@ abstract class Php7ActionContainerTests extends BasicActionRunnerTests with WskA

val code = ZipBuilder.mkBase64Zip(srcs)

withPhp7Container { c =>
withPhp8Container { c =>
c.init(initPayload(code))._1 should be(200)

val (runCode, runRes) = c.run(runPayload(JsObject()))
Expand All @@ -523,7 +523,7 @@ abstract class Php7ActionContainerTests extends BasicActionRunnerTests with WskA

val code = ZipBuilder.mkBase64Zip(srcs)

withPhp7Container { c =>
withPhp8Container { c =>
c.init(initPayload(code))._1 should be(200)

val (runCode, runRes) = c.run(runPayload(JsArray(JsString("a"), JsString("b"))))
Expand Down

0 comments on commit eade493

Please sign in to comment.