-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* add docker-compose support * req --dev phpunit/phpunit matthiasnoback/symfony-config-test so that they support at least php 7.1 * add unit tests and one behat test with chrome * add PHP 7.4 to travis and adopt script section * init CHANGELOG.md
- Loading branch information
1 parent
10087b4
commit 338dab1
Showing
14 changed files
with
446 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
1.0.1 / 2020- | ||
================== | ||
|
||
Features: | ||
* Enabled configuration per driver instance; usage examples with all sessions using mink-panther-driver: | ||
```YAML | ||
# in behat.yml | ||
extensions: | ||
Robertfausk\Behat\PantherExtension: ~ # no configuration here | ||
Behat\MinkExtension: | ||
javascript_session: javascript_chrome | ||
sessions: | ||
default: | ||
panther: ~ | ||
javascript: | ||
panther: | ||
options: ~ | ||
javascript_chrome: | ||
panther: | ||
options: | ||
browser: 'chrome' | ||
webServerDir: '%paths.base%/public' | ||
javascript_firefox: | ||
panther: | ||
options: | ||
browser: 'firefox' | ||
``` | ||
Testsuite: | ||
* Enabled travis at all with phpunit and behat for PHP 7.1-7.4 | ||
* Added PHP 7.4 in the CI | ||
* Added Unit Tests | ||
* Added one simple scenario test with behat | ||
1.0.0 / 2019-08-16 | ||
================== | ||
Initial Release :tada: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
ARG PHP_VERSION=7.2 | ||
|
||
FROM composer:latest as composer | ||
FROM php:${PHP_VERSION}-cli | ||
|
||
# replace shell with bash so we can source files | ||
RUN rm /bin/sh && ln -s /bin/bash /bin/sh | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
git-core | ||
|
||
|
||
COPY --from=composer /usr/bin/composer /usr/bin/composer | ||
|
||
# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser | ||
ENV COMPOSER_ALLOW_SUPERUSER 1 | ||
ENV COMPOSER_HOME /home/docker/.composer | ||
# contains dev-mode packages | ||
RUN composer global require "hirak/prestissimo:^0.3" "sllh/composer-versions-check:^2.0" "pyrech/composer-changelogs:^1.7" --prefer-dist --no-progress --no-suggest --classmap-authoritative | ||
|
||
############################################################## | ||
# add symfony/panther | ||
############################################################## | ||
RUN apt-get update && apt-get install -y libzip-dev zlib1g-dev unzip chromium && docker-php-ext-install zip | ||
ENV PANTHER_NO_SANDBOX 1 | ||
|
||
############################################################## | ||
# add gd | ||
############################################################## | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
libjpeg-dev \ | ||
libpng-dev | ||
|
||
RUN docker-php-ext-configure gd --with-jpeg-dir=/usr/include/ && \ | ||
docker-php-ext-install gd | ||
|
||
WORKDIR /var/www/html | ||
COPY . /var/www/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
version: "3" | ||
services: | ||
|
||
php7.1: | ||
tty: true | ||
build: | ||
context: . | ||
args: | ||
- PHP_VERSION=7.1 | ||
volumes: | ||
- .:/var/www/html | ||
|
||
php7.2: | ||
tty: true | ||
build: | ||
context: . | ||
args: | ||
- PHP_VERSION=7.2 | ||
volumes: | ||
- .:/var/www/html | ||
|
||
php7.3: | ||
tty: true | ||
build: | ||
context: . | ||
args: | ||
- PHP_VERSION=7.3 | ||
volumes: | ||
- .:/var/www/html | ||
|
||
php7.4: | ||
tty: true | ||
build: | ||
context: . | ||
args: | ||
- PHP_VERSION=7.4 | ||
volumes: | ||
- .:/var/www/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit colors="true" bootstrap="vendor/autoload.php"> | ||
<php> | ||
<var name="driver_config_factory" value="Behat\Mink\Tests\Driver\PantherConfig::getInstance" /> | ||
</php> | ||
|
||
<extensions> | ||
<extension class="Symfony\Component\Panther\ServerExtension" /> | ||
</extensions> | ||
|
||
<testsuites> | ||
<testsuite name="Driver test suite"> | ||
<directory>./tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory>./src</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/Robertfausk/Behat/PantherExtension/ServiceContainer/PantherConfiguration.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Robertfausk\Behat\PantherExtension\ServiceContainer; | ||
|
||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; | ||
use Symfony\Component\Config\Definition\Builder\TreeBuilder; | ||
use Symfony\Component\Config\Definition\ConfigurationInterface; | ||
|
||
/** | ||
* @author Robert Freigang <[email protected]> | ||
*/ | ||
class PantherConfiguration implements ConfigurationInterface | ||
{ | ||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getConfigTreeBuilder() | ||
{ | ||
$treeBuilder = new TreeBuilder('panther'); | ||
if (\method_exists($treeBuilder, 'getRootNode')) { | ||
$root = $treeBuilder->getRootNode(); | ||
} else { | ||
$root = $treeBuilder->root('panther'); | ||
} | ||
|
||
$root->append($this->addOptionsNode()); | ||
|
||
return $treeBuilder; | ||
} | ||
|
||
public function addOptionsNode(): ArrayNodeDefinition | ||
{ | ||
$treeBuilder = new TreeBuilder('options'); | ||
|
||
$node = $treeBuilder->getRootNode() | ||
->info( | ||
"These are the options passed as first argument to PantherTestCaseTrait::createPantherClient client constructor." | ||
) | ||
->ignoreExtraKeys() | ||
->scalarPrototype() | ||
->end() | ||
; | ||
|
||
return $node; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
default: | ||
suites: | ||
web: | ||
paths: | ||
- '%paths.base%/features' | ||
contexts: | ||
- Behat\MinkExtension\Context\MinkContext | ||
extensions: | ||
Robertfausk\Behat\PantherExtension: ~ # no configuration here | ||
Behat\MinkExtension: | ||
browser_name: chrome | ||
javascript_session: javascript_chrome | ||
sessions: | ||
default: | ||
panther: | ||
options: | ||
webServerDir: '%paths.base%/public' | ||
javascript: | ||
panther: | ||
options: ~ | ||
javascript_chrome: | ||
panther: | ||
options: | ||
browser: 'chrome' | ||
webServerDir: '%paths.base%/public' | ||
javascript_firefox: | ||
panther: | ||
options: | ||
browser: 'firefox' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Feature: Just a simple call to a php script | ||
|
||
@javascript_chrome | ||
Scenario: I am on a php and see the echo response | ||
And I am on "index.php" | ||
Then I should see "Huhuuu!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
echo '<div id="output"></div>'; | ||
|
||
echo '<script type="application/javascript">window.document.getElementById("output").append("Huhuuu!")</script>'; |
Oops, something went wrong.