Skip to content

Commit 81f9633

Browse files
committed
Implemented features/install-in-pie-project.feature as Behat test
1 parent 4bea386 commit 81f9633

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

.github/pie-behaviour-tests/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
#
44
# docker buildx build --file .github/pie-behaviour-tests/Dockerfile -t pie-behat-test .
55
# docker run --volume .:/github/workspace -ti pie-behat-test
6-
FROM ubuntu:24.04
6+
FROM alpine/git:v2.49.1 AS clone_ext_repo
7+
8+
RUN cd / && git clone https://github.com/asgrim/example-pie-extension.git
9+
10+
FROM ubuntu:24.04 AS default
711

812
# Add the `unzip` package which PIE uses to extract .zip files
913
RUN export DEBIAN_FRONTEND="noninteractive"; \
@@ -36,6 +40,8 @@ RUN touch /usr/local/lib/php.ini
3640
COPY --from=ghcr.io/php/pie:bin /pie /usr/bin/pie
3741
RUN pie install xdebug/xdebug
3842

43+
COPY --from=clone_ext_repo /example-pie-extension /example-pie-extension
44+
3945
WORKDIR /github/workspace
4046

4147
ENV USING_PIE_BEHAT_DOCKERFILE=1

test/behaviour/CliContext.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,4 +357,21 @@ public function iShouldSeeAllTheExtensionsAreNowInstalled(): void
357357
$this->assertCommandSuccessful();
358358
Assert::contains($this->output, 'example_pie_extension');
359359
}
360+
361+
#[Given('I am in a PIE project')]
362+
public function iAmInAPIEProject(): void
363+
{
364+
$examplePieProject = (string) realpath('/example-pie-extension');
365+
assert($examplePieProject !== '');
366+
367+
$this->workingDirectory = $examplePieProject;
368+
}
369+
370+
#[When('I run a command to install the extension')]
371+
public function iRunACommandToInstallTheExtension(): void
372+
{
373+
$this->theExtension = 'example_pie_extension';
374+
$this->thePackage = 'asgrim/example-pie-extension';
375+
$this->runPieCommand(['install']);
376+
}
360377
}

0 commit comments

Comments
 (0)