From 1101f0b2ed78baf95cf205aa499d4bea8a4991ef Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Sun, 17 Dec 2023 21:46:48 +0100 Subject: [PATCH] Add support for newer PHP versions --- .github/workflows/ci.yaml | 2 +- composer.json | 2 +- tests/spec/RulerZ/Context/ExecutionContextSpec.php | 4 ++-- tests/spec/RulerZ/Context/ObjectContextSpec.php | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index af985af..a38a036 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: [7.2] + php: [7.2, 7.3, 7.4, 8.0, 8.1, 8.2] fail-fast: true steps: - uses: actions/checkout@v4 diff --git a/composer.json b/composer.json index 1172a43..37555a5 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ "ext-json": "*", "mikey179/vfsstream": "~1.4", - "phpspec/phpspec": "~4.0", + "phpspec/phpspec": "~6.0|~7.0", "behat/behat": "~3.0", diff --git a/tests/spec/RulerZ/Context/ExecutionContextSpec.php b/tests/spec/RulerZ/Context/ExecutionContextSpec.php index e4732f9..e56ffce 100644 --- a/tests/spec/RulerZ/Context/ExecutionContextSpec.php +++ b/tests/spec/RulerZ/Context/ExecutionContextSpec.php @@ -29,8 +29,8 @@ public function it_allows_property_access_through_offset($object) public function it_allows_testing_property_existence($object) { - $this->offsetExists('some')->shouldReturn(true); - $this->offsetExists('non_existent_offset')->shouldReturn(false); + $this->shouldHaveKey('some'); + $this->shouldNotHaveKey('non_existent_offset'); } public function it_forbids_setting_properties() diff --git a/tests/spec/RulerZ/Context/ObjectContextSpec.php b/tests/spec/RulerZ/Context/ObjectContextSpec.php index 88a8b67..48a0116 100644 --- a/tests/spec/RulerZ/Context/ObjectContextSpec.php +++ b/tests/spec/RulerZ/Context/ObjectContextSpec.php @@ -38,8 +38,8 @@ public function it_allows_testing_property_existence($object) { $object->property = 42; - $this->offsetExists('property')->shouldReturn(true); - $this->offsetExists('non_existent_property')->shouldReturn(false); + $this->shouldHaveKey('property'); + $this->shouldNotHaveKey('non_existent_property'); } public function it_forbids_setting_properties()