Commit 7ea034d0 authored by reminec's avatar reminec
Browse files

Install behatch extensions. Not currently enabled

parent 4a95a75e
Pipeline #343019 failed with stage
in 1 minute and 6 seconds
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "f83fec4a83915764554d5a4c9ff8c8c6",
"content-hash": "8806c3d2fa5420c7c7a63be8664dfaef",
"packages": [
{
"name": "api-platform/api-pack",
......@@ -5834,37 +5834,39 @@
"packages-dev": [
{
"name": "behat/behat",
"version": "v3.5.0",
"version": "v3.7.0",
"source": {
"type": "git",
"url": "https://github.com/Behat/Behat.git",
"reference": "e4bce688be0c2029dc1700e46058d86428c63cab"
"reference": "08052f739619a9e9f62f457a67302f0715e6dd13"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Behat/Behat/zipball/e4bce688be0c2029dc1700e46058d86428c63cab",
"reference": "e4bce688be0c2029dc1700e46058d86428c63cab",
"url": "https://api.github.com/repos/Behat/Behat/zipball/08052f739619a9e9f62f457a67302f0715e6dd13",
"reference": "08052f739619a9e9f62f457a67302f0715e6dd13",
"shasum": ""
},
"require": {
"behat/gherkin": "^4.5.1",
"behat/gherkin": "^4.6.0",
"behat/transliterator": "^1.2",
"container-interop/container-interop": "^1.2",
"ext-mbstring": "*",
"php": ">=5.3.3",
"psr/container": "^1.0",
"symfony/class-loader": "~2.1||~3.0",
"symfony/config": "~2.3||~3.0||~4.0",
"symfony/console": "~2.7.40||^2.8.33||~3.3.15||^3.4.3||^4.0.3",
"symfony/dependency-injection": "~2.1||~3.0||~4.0",
"symfony/event-dispatcher": "~2.1||~3.0||~4.0",
"symfony/translation": "~2.3||~3.0||~4.0",
"symfony/yaml": "~2.1||~3.0||~4.0"
"symfony/config": "^2.7.51 || ^3.0 || ^4.0 || ^5.0",
"symfony/console": "^2.7.51 || ^2.8.33 || ^3.3.15 || ^3.4.3 || ^4.0.3 || ^5.0",
"symfony/dependency-injection": "^2.7.51 || ^3.0 || ^4.0 || ^5.0",
"symfony/event-dispatcher": "^2.7.51 || ^3.0 || ^4.0 || ^5.0",
"symfony/translation": "^2.7.51 || ^3.0 || ^4.0 || ^5.0",
"symfony/yaml": "^2.7.51 || ^3.0 || ^4.0 || ^5.0"
},
"require-dev": {
"container-interop/container-interop": "^1.2",
"herrera-io/box": "~1.6.1",
"phpunit/phpunit": "^4.8.36|^6.3",
"symfony/process": "~2.5|~3.0|~4.0"
"phpunit/phpunit": "^4.8.36 || ^6.5.14 || ^7.5.20",
"symfony/process": "~2.5 || ^3.0 || ^4.0 || ^5.0"
},
"suggest": {
"ext-dom": "Needed to output test results in JUnit format."
},
"bin": [
"bin/behat"
......@@ -5872,13 +5874,13 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.5.x-dev"
"dev-master": "3.6.x-dev"
}
},
"autoload": {
"psr-0": {
"Behat\\Behat": "src/",
"Behat\\Testwork": "src/"
"psr-4": {
"Behat\\Behat\\": "src/Behat/Behat/",
"Behat\\Testwork\\": "src/Behat/Testwork/"
}
},
"notification-url": "https://packagist.org/downloads/",
......@@ -5908,7 +5910,7 @@
"symfony",
"testing"
],
"time": "2018-08-10T18:56:51+00:00"
"time": "2020-06-03T13:08:44+00:00"
},
{
"name": "behat/gherkin",
......@@ -5969,6 +5971,67 @@
],
"time": "2019-01-16T14:22:17+00:00"
},
{
"name": "behat/mink",
"version": "v1.8.1",
"source": {
"type": "git",
"url": "https://github.com/minkphp/Mink.git",
"reference": "07c6a9fe3fa98c2de074b25d9ed26c22904e3887"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/minkphp/Mink/zipball/07c6a9fe3fa98c2de074b25d9ed26c22904e3887",
"reference": "07c6a9fe3fa98c2de074b25d9ed26c22904e3887",
"shasum": ""
},
"require": {
"php": ">=5.3.1",
"symfony/css-selector": "^2.7|^3.0|^4.0|^5.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20",
"symfony/debug": "^2.7|^3.0|^4.0",
"symfony/phpunit-bridge": "^3.4.38 || ^5.0.5"
},
"suggest": {
"behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)",
"behat/mink-goutte-driver": "fast headless driver for any app without JS emulation",
"behat/mink-selenium2-driver": "slow, but JS-enabled driver for any app (requires Selenium2)",
"behat/mink-zombie-driver": "fast and JS-enabled headless driver for any app (requires node.js)",
"dmore/chrome-mink-driver": "fast and JS-enabled driver for any app (requires chromium or google chrome)"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.8.x-dev"
}
},
"autoload": {
"psr-4": {
"Behat\\Mink\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Konstantin Kudryashov",
"email": "ever.zet@gmail.com",
"homepage": "http://everzet.com"
}
],
"description": "Browser controller/emulator abstraction for PHP",
"homepage": "http://mink.behat.org/",
"keywords": [
"browser",
"testing",
"web"
],
"time": "2020-03-11T15:45:53+00:00"
},
{
"name": "behat/symfony2-extension",
"version": "2.1.5",
......@@ -6030,6 +6093,63 @@
],
"time": "2018-04-20T15:48:23+00:00"
},
{
"name": "behatch/contexts",
"version": "3.3.0",
"source": {
"type": "git",
"url": "https://github.com/Behatch/contexts.git",
"reference": "e45284b1dddb9dce78e186a56683527802bccd47"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Behatch/contexts/zipball/e45284b1dddb9dce78e186a56683527802bccd47",
"reference": "e45284b1dddb9dce78e186a56683527802bccd47",
"shasum": ""
},
"require": {
"behat/behat": "^3.0.13",
"friends-of-behat/mink-extension": "^2.3.1",
"justinrainbow/json-schema": "^5.0",
"php": ">=5.5",
"symfony/dom-crawler": "^2.4|^3.0|^4.0|^5.0",
"symfony/http-foundation": "^2.3|^3.0|^4.0|^5.0",
"symfony/property-access": "^2.3|^3.0|^4.0|^5.0"
},
"replace": {
"sanpi/behatch-contexts": "self.version"
},
"require-dev": {
"atoum/atoum": "^2.8|^3.0",
"behat/mink-goutte-driver": "^1.1",
"behat/mink-selenium2-driver": "^1.4@dev",
"fabpot/goutte": "^3.2",
"guzzlehttp/guzzle": "^6.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Behatch\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"beerware"
],
"description": "Behatch contexts",
"keywords": [
"BDD",
"Behat",
"Context",
"Symfony2"
],
"time": "2020-02-27T08:40:50+00:00"
},
{
"name": "container-interop/container-interop",
"version": "1.2.0",
......@@ -6262,6 +6382,65 @@
"description": "A php library to manipulate Swagger specifications",
"time": "2018-07-27T06:40:00+00:00"
},
{
"name": "friends-of-behat/mink-extension",
"version": "2.3.1",
"source": {
"type": "git",
"url": "https://github.com/FriendsOfBehat/MinkExtension.git",
"reference": "80f7849ba53867181b7e412df9210e12fba50177"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/FriendsOfBehat/MinkExtension/zipball/80f7849ba53867181b7e412df9210e12fba50177",
"reference": "80f7849ba53867181b7e412df9210e12fba50177",
"shasum": ""
},
"require": {
"behat/behat": "^3.0.5",
"behat/mink": "^1.5",
"php": ">=5.3.2",
"symfony/config": "^2.7|^3.0|^4.0"
},
"require-dev": {
"behat/mink-goutte-driver": "^1.1",
"phpspec/phpspec": "^2.0"
},
"type": "behat-extension",
"extra": {
"branch-alias": {
"dev-master": "2.1.x-dev"
}
},
"autoload": {
"psr-0": {
"Behat\\MinkExtension": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Konstantin Kudryashov",
"email": "ever.zet@gmail.com"
},
{
"name": "Christophe Coevoet",
"email": "stof@notk.org"
}
],
"description": "Mink extension for Behat",
"homepage": "http://extensions.behat.org/mink",
"keywords": [
"browser",
"gui",
"test",
"web"
],
"time": "2018-02-06T15:36:30+00:00"
},
{
"name": "guzzlehttp/guzzle",
"version": "6.3.3",
......@@ -6449,6 +6628,72 @@
],
"time": "2019-07-01T23:21:34+00:00"
},
{
"name": "justinrainbow/json-schema",
"version": "5.2.10",
"source": {
"type": "git",
"url": "https://github.com/justinrainbow/json-schema.git",
"reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b",
"reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1",
"json-schema/json-schema-test-suite": "1.2.0",
"phpunit/phpunit": "^4.8.35"
},
"bin": [
"bin/validate-json"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "5.0.x-dev"
}
},
"autoload": {
"psr-4": {
"JsonSchema\\": "src/JsonSchema/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Bruno Prieto Reis",
"email": "bruno.p.reis@gmail.com"
},
{
"name": "Justin Rainbow",
"email": "justin.rainbow@gmail.com"
},
{
"name": "Igor Wiedler",
"email": "igor@wiedler.ch"
},
{
"name": "Robert Schönthal",
"email": "seroscho@googlemail.com"
}
],
"description": "A library to validate a json schema.",
"homepage": "https://github.com/justinrainbow/json-schema",
"keywords": [
"json",
"schema"
],
"time": "2020-05-27T16:41:55+00:00"
},
{
"name": "league/oauth2-client",
"version": "2.4.1",
......@@ -8211,6 +8456,59 @@
"homepage": "https://symfony.com",
"time": "2019-08-20T13:31:17+00:00"
},
{
"name": "symfony/css-selector",
"version": "v4.3.11",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
"reference": "32203e7cc318dcfd1d5fb12ab35e595fc6016206"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/32203e7cc318dcfd1d5fb12ab35e595fc6016206",
"reference": "32203e7cc318dcfd1d5fb12ab35e595fc6016206",
"shasum": ""
},
"require": {
"php": "^7.1.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.3-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\CssSelector\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Jean-François Simon",
"email": "jeanfrancois.simon@sensiolabs.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony CssSelector Component",
"homepage": "https://symfony.com",
"time": "2020-01-04T12:24:57+00:00"
},
{
"name": "symfony/debug-bundle",
"version": "v4.3.11",
......
......@@ -4,6 +4,7 @@
use App\Application;
use App\Entity\Poll;
use App\Entity\PollCandidate;
use App\Entity\User;
use App\Features\Actor;
use App\Features\Actors;
use App\Repository\PollCandidateRepository;
......@@ -15,15 +16,10 @@ use Doctrine\Common\Persistence\ObjectRepository;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityRepository;
use Liip\FunctionalTestBundle\Test\WebTestCase;
use MsgPhp\User\Command\CreateUser;
use MsgPhp\User\Infrastructure\Doctrine\Repository\UserRepository;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Yaml\Yaml;
//use FOS\UserBundle\Model\UserManager;
/**
* This context class contains the definitions of the steps used by the demo
* feature file. Learn how to get started with Behat and BDD on Behat's website.
......@@ -446,26 +442,19 @@ class BaseFeatureContext extends WebTestCase implements Context
{
$identifier = uniqid("citizen-", true);
$email = "${identifier}@test.assemblee-liquide.fr";
$pseudonym = $name;
$token = md5(uniqid()); // security is irrelevant, since those are test users
$this->getMessageBus()->dispatch(new CreateUser([
// 'id' => new ScalarUserId(),
'name' => $name,
'email' => $email,
'password' => $token,
]));
$user = $this->getUserRepository()->findByUsername($email);
$encodedPassword = $this->get('security.password_encoder')->encodePassword($user, $token);
$user->getCredential()(new \MsgPhp\User\Event\Domain\ChangeCredential([
'password' => $encodedPassword,
]));
$this->getEntityManager()->flush();
return ['user' => $user, 'token' => $token];
$password = md5(uniqid()); // security is irrelevant, since those are test users
$user = new User();
$user
->setEmail($email)
->setPlainPassword($password)
->setUsername($name);
// FIXME call a persist here
// Should we use App\DataProvider\UserDataProvider::persist() to ensure encryption password ?
return ['user' => $user, 'token' => $password];
}
......
......@@ -9,7 +9,6 @@
use App\Entity\Poll;
use App\Entity\PollCandidate;
use App\Entity\User;
use MsgPhp\User\Command\AddUserRole;
/**
......
......@@ -88,8 +88,7 @@ class User implements UserInterface
* @SerializedName("password")
*/
private $plainPassword;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Poll", mappedBy="author")
* @Groups({"User:read"})
......@@ -102,6 +101,12 @@ class User implements UserInterface
*/
private $votes;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"User:create", "User:read", "User:edit"})
*/
private $username;
public function __construct()
{
$this->polls = new ArrayCollection();
......@@ -257,4 +262,11 @@ class User implements UserInterface
return $this;
}
public function setUsername(?string $username): self
{
$this->username = $username;
return $this;
}
}
......@@ -22,6 +22,9 @@
"behat/gherkin": {
"version": "v4.6.0"
},
"behat/mink": {
"version": "v1.8.1"
},
"behat/symfony2-extension": {
"version": "2.1",
"recipe": {
......@@ -41,6 +44,9 @@
"behat/transliterator": {
"version": "v1.2.0"
},
"behatch/contexts": {
"version": "3.3.0"
},
"container-interop/container-interop": {
"version": "1.2.0"
},
......@@ -131,6 +137,9 @@
"fig/link-util": {
"version": "1.0.0"
},
"friends-of-behat/mink-extension": {
"version": "2.3.1"
},
"gedmo/doctrine-extensions": {
"version": "v2.4.37"
},
......@@ -146,6 +155,9 @@
"jdorn/sql-formatter": {
"version": "v1.2.17"
},
"justinrainbow/json-schema": {
"version": "5.2.10"
},
"lcobucci/jwt": {
"version": "3.3.3"
},
......@@ -382,6 +394,9 @@
"config/bootstrap.php"
]
},
"symfony/css-selector": {
"version": "v4.3.11"
},
"symfony/debug": {
"version": "v4.3.4"
},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment