Skip to content
Snippets Groups Projects
Commit 610d07fb authored by Sebastien Curt's avatar Sebastien Curt
Browse files

Add user story application test

parent 9dd5faf4
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !8. Comments created here will be created in the context of that merge request.
......@@ -30,3 +30,33 @@ APP_SECRET=55ba185719845f708d18a2739b07c44a
# DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7"
DATABASE_URL="mysql://rekallfrwsmember:sm4SyZVPu6wpjZfg@mysql:3306/rekallfrwsmember?serverVersion=5.6&charset=utf8"
###< doctrine/doctrine-bundle ###
# Set the docker-compose to use
# for production with a traefik frontend
# docker-compose.yml:traefik.yml
# for development purposes
# docker-compose.yml:dev.yml
COMPOSE_FILE=docker-compose.yml
# local for development or test, prod for production
ENV=local
# error, notice, info or debug
LOG_LEVEL=debug
# Ports to access front and symfony using dev.yml
MEMOREKALL_MEMBER_PORT=8081
# Source path
# Symfony Configuration
APP_DEBUG=1
# If this fails, replace ${MYSQL_DATABASE:-rekallfrwsmember} by rekallfrwsmember
# and do the same for the other variables
MYSQL_DATABASE=${MYSQL_DATABASE:-rekallfrwsmember}
MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-root}
MYSQL_USER=${MYSQL_USER:-rekallfrwsmember}
MYSQL_PASSWORD=${MYSQL_PASSWORD:-sm4SyZVPu6wpjZfg}
BY_PASS_CODE=ed156b9188ecddf0c556d5712f0a84cc
# Use smtp or mail in production
MAILER_DSN=null://null
SYMFONY_SECRET=0f817363a768f111a17d2522b8d7e2d72cf738b1
\ No newline at end of file
......@@ -4,3 +4,6 @@ APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
PANTHER_APP_ENV=panther
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
DATABASE_URL="mysql://rekallfrwsmember:sm4SyZVPu6wpjZfg@mysql:3306/rekallfrwsmember?serverVersion=5.6&charset=utf8"
BY_PASS_CODE=ed156b9188ecddf0c556d5712f0a84cc
\ No newline at end of file
......@@ -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": "ce53d22b36fff2dd4dfc9f67b5f8e87a",
"content-hash": "e79713ea98e230cc6acefeabf296273d",
"packages": [
{
"name": "composer/package-versions-deprecated",
......@@ -7889,6 +7889,232 @@
}
],
"packages-dev": [
{
"name": "dama/doctrine-test-bundle",
"version": "v6.7.1",
"source": {
"type": "git",
"url": "https://github.com/dmaicher/doctrine-test-bundle.git",
"reference": "2ccf6653ce9c7bf46ae53b2e5bbbb60417d9e3e1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dmaicher/doctrine-test-bundle/zipball/2ccf6653ce9c7bf46ae53b2e5bbbb60417d9e3e1",
"reference": "2ccf6653ce9c7bf46ae53b2e5bbbb60417d9e3e1",
"shasum": ""
},
"require": {
"doctrine/dbal": "^2.9.3 || ^3.0",
"doctrine/doctrine-bundle": "^1.11 || ^2.0",
"php": "^7.1 || ^8.0",
"psr/cache": "^1.0 || ^2.0 || ^3.0",
"symfony/cache": "^4.4 || ^5.3 || ^6.0",
"symfony/framework-bundle": "^4.4 || ^5.3 || ^6.0"
},
"require-dev": {
"behat/behat": "^3.0",
"doctrine/cache": "^1.12",
"phpstan/phpstan": "^0.12.85",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
"symfony/phpunit-bridge": "^5.3 || ^6.0",
"symfony/process": "^4.4 || ^5.3 || ^6.0",
"symfony/yaml": "^4.4 || ^5.3 || ^6.0"
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "6.x-dev"
}
},
"autoload": {
"psr-4": {
"DAMA\\DoctrineTestBundle\\": "src/DAMA/DoctrineTestBundle"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "David Maicher",
"email": "mail@dmaicher.de"
}
],
"description": "Symfony bundle to isolate doctrine database tests and improve test performance",
"keywords": [
"doctrine",
"isolation",
"performance",
"symfony",
"tests"
],
"support": {
"issues": "https://github.com/dmaicher/doctrine-test-bundle/issues",
"source": "https://github.com/dmaicher/doctrine-test-bundle/tree/v6.7.1"
},
"time": "2021-11-09T11:55:09+00:00"
},
{
"name": "doctrine/data-fixtures",
"version": "1.5.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/data-fixtures.git",
"reference": "f18adf13f6c81c67a88360dca359ad474523f8e3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/data-fixtures/zipball/f18adf13f6c81c67a88360dca359ad474523f8e3",
"reference": "f18adf13f6c81c67a88360dca359ad474523f8e3",
"shasum": ""
},
"require": {
"doctrine/common": "^2.13|^3.0",
"doctrine/persistence": "^1.3.3|^2.0",
"php": "^7.2 || ^8.0"
},
"conflict": {
"doctrine/phpcr-odm": "<1.3.0"
},
"require-dev": {
"doctrine/coding-standard": "^9.0",
"doctrine/dbal": "^2.5.4 || ^3.0",
"doctrine/mongodb-odm": "^1.3.0 || ^2.0.0",
"doctrine/orm": "^2.7.0",
"ext-sqlite3": "*",
"phpunit/phpunit": "^8.0"
},
"suggest": {
"alcaeus/mongo-php-adapter": "For using MongoDB ODM 1.3 with PHP 7 (deprecated)",
"doctrine/mongodb-odm": "For loading MongoDB ODM fixtures",
"doctrine/orm": "For loading ORM fixtures",
"doctrine/phpcr-odm": "For loading PHPCR ODM fixtures"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Common\\DataFixtures\\": "lib/Doctrine/Common/DataFixtures"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
}
],
"description": "Data Fixtures for all Doctrine Object Managers",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"database"
],
"support": {
"issues": "https://github.com/doctrine/data-fixtures/issues",
"source": "https://github.com/doctrine/data-fixtures/tree/1.5.1"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdata-fixtures",
"type": "tidelift"
}
],
"time": "2021-09-20T21:51:43+00:00"
},
{
"name": "doctrine/doctrine-fixtures-bundle",
"version": "3.4.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/DoctrineFixturesBundle.git",
"reference": "31ba202bebce0b66fe830f49f96228dcdc1503e7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/DoctrineFixturesBundle/zipball/31ba202bebce0b66fe830f49f96228dcdc1503e7",
"reference": "31ba202bebce0b66fe830f49f96228dcdc1503e7",
"shasum": ""
},
"require": {
"doctrine/data-fixtures": "^1.3",
"doctrine/doctrine-bundle": "^1.11|^2.0",
"doctrine/orm": "^2.6.0",
"doctrine/persistence": "^1.3.7|^2.0",
"php": "^7.1 || ^8.0",
"symfony/config": "^3.4|^4.3|^5.0|^6.0",
"symfony/console": "^3.4|^4.3|^5.0|^6.0",
"symfony/dependency-injection": "^3.4.47|^4.3|^5.0|^6.0",
"symfony/doctrine-bridge": "^3.4|^4.1|^5.0|^6.0",
"symfony/http-kernel": "^3.4|^4.3|^5.0|^6.0"
},
"require-dev": {
"doctrine/coding-standard": "^8.0",
"phpstan/phpstan": "^0.12.99",
"phpunit/phpunit": "^7.4 || ^8.0 || ^9.2",
"symfony/phpunit-bridge": "^4.1|^5.0|^6.0",
"vimeo/psalm": "^4.10"
},
"type": "symfony-bundle",
"autoload": {
"psr-4": {
"Doctrine\\Bundle\\FixturesBundle\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Doctrine Project",
"homepage": "http://www.doctrine-project.org"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony DoctrineFixturesBundle",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"Fixture",
"persistence"
],
"support": {
"issues": "https://github.com/doctrine/DoctrineFixturesBundle/issues",
"source": "https://github.com/doctrine/DoctrineFixturesBundle/tree/3.4.1"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdoctrine-fixtures-bundle",
"type": "tidelift"
}
],
"time": "2021-10-28T05:46:28+00:00"
},
{
"name": "myclabs/deep-copy",
"version": "1.10.2",
......
......@@ -15,4 +15,6 @@ return [
SymfonyCasts\Bundle\VerifyEmail\SymfonyCastsVerifyEmailBundle::class => ['all' => true],
Gregwar\CaptchaBundle\GregwarCaptchaBundle::class => ['all' => true],
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
DAMA\DoctrineTestBundle\DAMADoctrineTestBundle::class => ['test' => true],
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
];
dama_doctrine_test:
enable_static_connection: true
enable_static_meta_data_cache: true
enable_static_query_cache: true
web_profiler:
toolbar: false
intercept_redirects: false
framework:
profiler: { collect: false }
......@@ -39,4 +39,7 @@
<extension class="Symfony\Component\Panther\ServerExtension" />
</extensions>
-->
<extensions>
<extension class="DAMA\DoctrineTestBundle\PHPUnit\PHPUnitExtension"/>
</extensions>
</phpunit>
<?php
namespace App\DataFixtures;
use App\Entity\User;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Persistence\ObjectManager;
class AppUserRegistrationFixture extends Fixture
{
public function load(ObjectManager $manager): void
{
$user = new User();
$user->setEmail("notVerified@localhost.com");
$user->setFirstName("Test");
$user->setLastName("Test LastName");
$user->setSalt("");
$user->setPassword("password");
$user->setRoles(["ROLE_USER"]);
$manager->persist($user);
$user->setEmail("defaultUser@localhost.com");
$user->setFirstName("Test");
$user->setLastName("Test LastName");
$user->setSalt("");
$user->setPassword("password");
$user->setRoles(["ROLE_USER"]);
$user->setIsVerified(true);
$manager->persist($user);
$manager->flush();
}
}
......@@ -53,6 +53,18 @@
"composer/package-versions-deprecated": {
"version": "1.11.99.4"
},
"dama/doctrine-test-bundle": {
"version": "6.7",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "master",
"version": "4.0",
"ref": "56eaa387b5e48ebcc7c95a893b47dfa1ad51449c"
},
"files": [
"config/packages/test/dama_doctrine_test_bundle.yaml"
]
},
"doctrine/annotations": {
"version": "1.13",
"recipe": {
......@@ -74,6 +86,9 @@
"doctrine/common": {
"version": "3.2.0"
},
"doctrine/data-fixtures": {
"version": "1.5.1"
},
"doctrine/dbal": {
"version": "3.1.4"
},
......@@ -96,6 +111,18 @@
"src/Entity/.gitignore"
]
},
"doctrine/doctrine-fixtures-bundle": {
"version": "3.4",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "3.0",
"ref": "1f5514cfa15b947298df4d771e694e578d4c204d"
},
"files": [
"src/DataFixtures/AppFixtures.php"
]
},
"doctrine/doctrine-migrations-bundle": {
"version": "3.2",
"recipe": {
......
......@@ -7,5 +7,5 @@ require dirname(__DIR__).'/vendor/autoload.php';
if (file_exists(dirname(__DIR__).'/config/bootstrap.php')) {
require dirname(__DIR__).'/config/bootstrap.php';
} elseif (method_exists(Dotenv::class, 'bootEnv')) {
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
(new Dotenv())->usePutenv(true)->bootEnv(dirname(__DIR__).'/.env');
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment