Commit db791832 authored by Thomas Citharel's avatar Thomas Citharel 🌲

Ajout de la CI

test tests :)

add ast

remove ast & phan
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

update lock
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

connect to gandi with secret variables
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>

fixup !
Signed-off-by: Thomas Citharel's avatarThomas Citharel <tcit@tcit.fr>
parent dd9997c4
Pipeline #25739 passed with stage
in 7 minutes and 9 seconds
/.web-server-pid
/app/config/parameters.yml
/app/config/parameters_test.yml
/build/
/phpunit.xml
/var/*
......
# This file is a template, and might need editing before it works on your project.
# Select image from https://hub.docker.com/_/php/
image: tetraweb/php
# Select what we should cache between builds
cache:
paths:
- vendor/
- node_modules
before_script:
- apt-get update -yqq
- apt-get install -yqq git zlib1g-dev ant libpq-dev libzip-dev libicu-dev
# Install PHP extensions
- docker-php-ext-install zip pgsql pdo_pgsql intl
# Bring in any services we need http://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-a-service
# See http://docs.gitlab.com/ce/ci/services/README.html for examples.
services:
- postgres:latest
# Set any variables we need
variables:
POSTGRES_DB: framasite_test
POSTGRES_USER: ci
POSTGRES_PASSWORD: test
TIMEZONE: "Europe/Paris"
# Run our tests
# If Xdebug was installed you can generate a coverage report and see code coverage metrics.
test:
script:
# Install and run Composer
- cp app/config/tests/parameters_test.pgsql.yml app/config/parameters_test.yml
- curl -sS https://getcomposer.org/installer | php
- SYMFONY_ENV=test php composer.phar install -o --no-interaction --no-progress --prefer-dist
- npm install
- git clone https://framagit.org/framasoft/framasite-grav grav
- mkdir blog/users -p
- mkdir wiki/users -p
- ant prepare-pgsql
- ./vendor/bin/simple-phpunit -v
......@@ -28,6 +28,7 @@ class AppKernel extends Kernel
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
if ('dev' === $this->getEnvironment()) {
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
......
imports:
- { resource: config_dev.yml }
- { resource: parameters_test.yml }
framework:
test: ~
......@@ -13,4 +14,23 @@ web_profiler:
intercept_redirects: false
swiftmailer:
disable_delivery: true
spool:
type: file
doctrine:
dbal:
driver: "%test_database_driver%"
host: "%test_database_host%"
port: "%test_database_port%"
dbname: "%test_database_name%"
user: "%test_database_user%"
password: "%test_database_password%"
charset: "%test_database_charset%"
path: ~
orm:
metadata_cache_driver:
type: service
id: filesystem_cache
query_cache_driver:
type: service
id: filesystem_cache
......@@ -34,6 +34,12 @@ services:
public: true
tags: ['controller.service_arguments']
# used for tests
filesystem_cache:
class: Doctrine\Common\Cache\FilesystemCache
arguments:
- "%kernel.cache_dir%/doctrine/metadata"
# add more services, or override services that need manual wiring
# AppBundle\Service\ExampleService:
# arguments:
......
parameters:
test_database_driver: pdo_mysql
test_database_host: localhost
test_database_port: 3306
test_database_name: framasites_test
test_database_user: root
test_database_password: ~
test_database_path: ~
test_database_charset: utf8mb4
parameters:
test_database_driver: pdo_pgsql
test_database_host: postgres
test_database_port:
test_database_name: framasite_test
test_database_user: ci
test_database_password: test
test_database_charset: utf8
payplug_api_key_test: test
payplug_api_key_prod: prod
payplug_api_mode: test
gandi_api_key_test: "%env(GANDI_APIKEY_TEST)%"
gandi_api_key_prod: tata
gandi_api_mode: test
gandi_id_test: "%env(GANDI_ID_TEST)%"
gandi_id_prod: non
parameters:
test_database_driver: pdo_sqlite
test_database_host: localhost
test_database_port:
test_database_name: ~
test_database_user: ~
test_database_password: ~
test_database_path: "%kernel.root_dir%/../data/db/framasites_test.sqlite"
test_database_charset: utf8
<?xml version="1.0" encoding="UTF-8"?>
<project name="wallabag" default="build">
<target name="build" depends="clean,prepare,phpunit"/>
<target name="prepare-mysql" depends="clean,prepare_mysql"/>
<target name="prepare-sqlite" depends="clean,prepare_sqlite"/>
<target name="prepare-pgsql" depends="clean,prepare_pgsql"/>
<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/var/cache"/>
</target>
<target name="prepare" description="Prepare for build">
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="doctrine:database:drop"/>
<arg value="--force"/>
<arg value="--env=test"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="doctrine:database:create"/>
<arg value="--env=test"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="doctrine:schema:create"/>
<arg value="--env=test"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="doctrine:fixtures:load"/>
<arg value="--no-interaction"/>
<arg value="--env=test"/>
</exec>
</target>
<target name="prepare_mysql" description="Run test for MySQL">
<delete dir="${basedir}/app/config/parameters.yml"/>
<exec executable="cp">
<arg value="${basedir}/app/config/tests/parameters_test.mysql.yml"/>
<arg value="${basedir}/app/config/parameters_test.yml"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="cache:clear"/>
<arg value="--env=test"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="doctrine:database:drop"/>
<arg value="--force"/>
<arg value="--env=test"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="doctrine:database:create"/>
<arg value="--env=test"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="doctrine:database:import"/>
<arg value="data/sql/mysql_base.sql"/>
<arg value="--env=test"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="doctrine:migrations:migrate"/>
<arg value="--no-interaction"/>
<arg value="--env=test"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="doctrine:fixtures:load"/>
<arg value="--no-interaction"/>
<arg value="--env=test"/>
</exec>
</target>
<target name="prepare_sqlite" description="Run test for SQLite">
<delete dir="${basedir}/app/config/parameters.yml"/>
<exec executable="cp">
<arg value="${basedir}/app/config/tests/parameters_test.sqlite.yml"/>
<arg value="${basedir}/app/config/parameters_test.yml"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="cache:clear"/>
<arg value="--env=test"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="doctrine:database:drop"/>
<arg value="--force"/>
<arg value="--env=test"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="doctrine:database:create"/>
<arg value="--env=test"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="doctrine:schema:create"/>
<arg value="--env=test"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="doctrine:migrations:migrate"/>
<arg value="--no-interaction"/>
<arg value="--env=test"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="doctrine:fixtures:load"/>
<arg value="--no-interaction"/>
<arg value="--env=test"/>
</exec>
</target>
<target name="prepare_pgsql" description="Run test for PostgreSQL">
<delete dir="${basedir}/app/config/parameters.yml"/>
<exec executable="cp">
<arg value="${basedir}/app/config/tests/parameters_test.pgsql.yml"/>
<arg value="${basedir}/app/config/parameters_test.yml"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="cache:clear"/>
<arg value="--env=test"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="doctrine:database:drop"/>
<arg value="--force"/>
<arg value="--env=test"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="doctrine:database:create"/>
<arg value="--env=test"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="doctrine:migrations:migrate"/>
<arg value="--no-interaction"/>
<arg value="--env=test"/>
</exec>
<exec executable="php">
<arg value="${basedir}/bin/console"/>
<arg value="doctrine:fixtures:load"/>
<arg value="--no-interaction"/>
<arg value="--env=test"/>
</exec>
</target>
<target name="phpunit" description="Run unit tests with PHPUnit + HTML Coverage">
<exec executable="phpunit" failonerror="true">
<arg value="--coverage-html"/>
<arg value="build/coverage"/>
</exec>
</target>
</project>
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "e45a338af68cf894891bc895199bdff7",
"content-hash": "788bc834aeb851d3000bfe8acea2eaf3",
"packages": [
{
"name": "barbieswimcrew/zip-code-validator",
......@@ -3315,35 +3315,35 @@
},
{
"name": "zendframework/zend-http",
"version": "2.6.0",
"version": "2.7.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-http.git",
"reference": "09f4d279f46d86be63171ff62ee0f79eca878678"
"reference": "78aa510c0ea64bfb2aa234f50c4f232c9531acfa"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zendframework/zend-http/zipball/09f4d279f46d86be63171ff62ee0f79eca878678",
"reference": "09f4d279f46d86be63171ff62ee0f79eca878678",
"url": "https://api.github.com/repos/zendframework/zend-http/zipball/78aa510c0ea64bfb2aa234f50c4f232c9531acfa",
"reference": "78aa510c0ea64bfb2aa234f50c4f232c9531acfa",
"shasum": ""
},
"require": {
"php": "^5.5 || ^7.0",
"zendframework/zend-loader": "^2.5",
"zendframework/zend-stdlib": "^2.5 || ^3.0",
"zendframework/zend-uri": "^2.5",
"zendframework/zend-validator": "^2.5"
"php": "^5.6 || ^7.0",
"zendframework/zend-loader": "^2.5.1",
"zendframework/zend-stdlib": "^3.1 || ^2.7.7",
"zendframework/zend-uri": "^2.5.2",
"zendframework/zend-validator": "^2.10.1"
},
"require-dev": {
"phpunit/phpunit": "^4.0",
"phpunit/phpunit": "^6.4.1 || ^5.7.15",
"zendframework/zend-coding-standard": "~1.0.0",
"zendframework/zend-config": "^2.5"
"zendframework/zend-config": "^3.1 || ^2.6"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.6-dev",
"dev-develop": "2.7-dev"
"dev-master": "2.7-dev",
"dev-develop": "2.8-dev"
}
},
"autoload": {
......@@ -3358,10 +3358,13 @@
"description": "provides an easy interface for performing Hyper-Text Transfer Protocol (HTTP) requests",
"homepage": "https://github.com/zendframework/zend-http",
"keywords": [
"ZendFramework",
"http",
"zf2"
"http client",
"zend",
"zf"
],
"time": "2017-01-31T14:41:02+00:00"
"time": "2017-10-13T12:06:24+00:00"
},
{
"name": "zendframework/zend-loader",
......@@ -3766,88 +3769,93 @@
],
"packages-dev": [
{
"name": "nikic/php-parser",
"version": "v3.1.1",
"name": "doctrine/data-fixtures",
"version": "v1.2.2",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "a1e8e1a30e1352f118feff1a8481066ddc2f234a"
"url": "https://github.com/doctrine/data-fixtures.git",
"reference": "17fa5bfe6ff52e35cb3d9ec37c934a2f4bd1fa2e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a1e8e1a30e1352f118feff1a8481066ddc2f234a",
"reference": "a1e8e1a30e1352f118feff1a8481066ddc2f234a",
"url": "https://api.github.com/repos/doctrine/data-fixtures/zipball/17fa5bfe6ff52e35cb3d9ec37c934a2f4bd1fa2e",
"reference": "17fa5bfe6ff52e35cb3d9ec37c934a2f4bd1fa2e",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"php": ">=5.5"
"doctrine/common": "~2.2",
"php": "^5.6 || ^7.0"
},
"conflict": {
"doctrine/orm": "< 2.4"
},
"require-dev": {
"phpunit/phpunit": "~4.0|~5.0"
"doctrine/dbal": "^2.5.4",
"doctrine/orm": "^2.5.4",
"phpunit/phpunit": "^5.4.6"
},
"suggest": {
"doctrine/mongodb-odm": "For loading MongoDB ODM fixtures",
"doctrine/orm": "For loading ORM fixtures",
"doctrine/phpcr-odm": "For loading PHPCR ODM fixtures"
},
"bin": [
"bin/php-parse"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
"dev-master": "1.3.x-dev"
}
},
"autoload": {
"psr-4": {
"PhpParser\\": "lib/PhpParser"
"psr-0": {
"Doctrine\\Common\\DataFixtures": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
"MIT"
],
"authors": [
{
"name": "Nikita Popov"
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
}
],
"description": "A PHP parser written in PHP",
"description": "Data Fixtures for all Doctrine Object Managers",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"parser",
"php"
"database"
],
"time": "2017-09-02T17:10:46+00:00"
"time": "2016-09-20T10:07:57+00:00"
},
{
"name": "phan/phan",
"version": "0.8.8",
"name": "doctrine/doctrine-fixtures-bundle",
"version": "v2.4.0",
"source": {
"type": "git",
"url": "https://github.com/phan/phan.git",
"reference": "9a559221a31526ff2f09947800cd6cc4ba592ac9"
"url": "https://github.com/doctrine/DoctrineFixturesBundle.git",
"reference": "7bb198c044b798b54e6be37c7929339aa645c3bf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phan/phan/zipball/9a559221a31526ff2f09947800cd6cc4ba592ac9",
"reference": "9a559221a31526ff2f09947800cd6cc4ba592ac9",
"url": "https://api.github.com/repos/doctrine/DoctrineFixturesBundle/zipball/7bb198c044b798b54e6be37c7929339aa645c3bf",
"reference": "7bb198c044b798b54e6be37c7929339aa645c3bf",
"shasum": ""
},
"require": {
"ext-ast": "^0.1.4",
"nikic/php-parser": "~3.1.1",
"php": "~7.0.0 || ~7.1.0 || ~7.2.0",
"symfony/console": "~2.3|~3.0"
"doctrine/data-fixtures": "~1.0",
"doctrine/doctrine-bundle": "~1.0",
"php": ">=5.3.2",
"symfony/doctrine-bridge": "~2.7|~3.0|~4.0"
},
"require-dev": {
"phpunit/phpunit": "^6.3.0"
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "2.4.x-dev"
}
},
"bin": [
"phan",
"phan_client",
"tocheckstyle"
],
"type": "project",
"autoload": {
"psr-4": {
"Phan\\": "src/Phan"
"Doctrine\\Bundle\\FixturesBundle\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
......@@ -3856,22 +3864,25 @@
],
"authors": [
{
"name": "Rasmus Lerdorf"
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{
"name": "Andrew S. Morrison"
"name": "Doctrine Project",
"homepage": "http://www.doctrine-project.org"
},
{
"name": "Tyson Andre"
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
}
],
"description": "A static analyzer for PHP",
"description": "Symfony DoctrineFixturesBundle",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"analyzer",
"php",
"static"
"Fixture",
"persistence"
],
"time": "2017-09-24T20:02:32+00:00"
"time": "2017-09-10T23:22:01+00:00"
},
{
"name": "sensio/generator-bundle",
......
......@@ -10,10 +10,11 @@
<php>
<ini name="error_reporting" value="-1" />
<server name="KERNEL_CLASS" value="AppKernel" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak" />
</php>
<testsuites>
<testsuite name="Project Test Suite">
<testsuite name="Framasite Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
......
<?php
namespace AppBundle\DataFixtures\ORM;
use AppBundle\Entity\Domain;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
class LoadDomainData extends AbstractFixture implements OrderedFixtureInterface
{
/**
* {@inheritdoc}
*/
public function load(ObjectManager $manager)
{
$domain1 = new Domain();
$domain1
->setDomainName('lablon.de')
->setExpiresAt(new \DateTime())
->setRegisteredAt((new \DateTime())->add(new \DateInterval('P1Y')))
->setRegisteredByFrama(true)
;
$manager->persist($domain1);
$this->addReference('foo-domain', $domain1);
$domain2 = new Domain();
$domain2->setDomainName('toto.com')
->setRegisteredByFrama(false)
;
$manager->persist($domain2);
$this->addReference('bar-domain', $domain2);
$domain3 = new Domain();
$domain3->setDomainName('tutu.com')
->setRegisteredByFrama(true);
$manager->persist($domain3);
$this->addReference('baz-domain', $domain3);
$manager->flush();
}
/**
* {@inheritdoc}
*/
public function getOrder()
{
return 25;
}
}
<?php
namespace AppBundle\DataFixtures\ORM;
use AppBundle\Entity\Blog\Blog;
use AppBundle\Entity\Wiki\Wiki;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
class LoadSiteData extends AbstractFixture implements OrderedFixtureInterface
{
/**
* {@inheritdoc}
*/
public function load(ObjectManager $manager)
{
$site1 = new Blog($this->getReference('admin-user'));
$site1->setSubdomain('toto');
$site1->setCreatedAt(new \DateTime());
$site1->setSiteName('Mon super site');
$site1->setSiteDescription('This is my description /o/');
$site1->setSiteKeywords('thomas, tutu');
$site1->addDomain($this->getReference('foo-domain'));
$site1->addDomain($this->getReference('baz-domain'));
$manager->persist($site1);
$this->addReference('site1', $site1);
$site2 = new Wiki($this->getReference('admin-user'));
$site2->setSubdomain('http://0.0.0.0/site2');
$site2->setPolicy(1);
$site2->setSiteName('Super wikis !');
$manager->persist($site2);
$this->addReference('site2', $site2);
$manager->flush();
}
/**
* {@inheritdoc}
*/
public function getOrder()
{
return 30;
}
}
<?php
namespace AppBundle\DataFixtures\ORM;
use AppBundle\Entity\User;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
class LoadUserData extends AbstractFixture implements OrderedFixtureInterface
{
/**
* {@inheritdoc}
*/
public function load(ObjectManager $manager)
{
$userAdmin = new User();
$userAdmin->setName('Super Admin');
$userAdmin->setEmail('superadmin@framasoft.org');
$userAdmin->setUsername('admin');
$userAdmin->setPlainPassword('mypassword');
$userAdmin->setEnabled(true);
$userAdmin->addRole('ROLE_SUPER_ADMIN');
$manager->persist($userAdmin);
$this->addReference('admin-user', $userAdmin);
$bobUser = new User();
$bobUser->setName('Bobby');
$bobUser->setEmail('bobby@framasoft.org');
$bobUser->setUsername('bob');
$bobUser->setPlainPassword('mypassword');
$bobUser->setEnabled(true);
$bobUser->setLocale('en');
$bobUser->setGandiId('EX123-GANDI');
$manager->persist($bobUser);
$this->addReference('bob-user', $bobUser);
$emptyUser = new User();
$emptyUser->setName('Empty');
$emptyUser->setEmail('empty@framasoft.org');
$emptyUser->setUsername('empty');
$emptyUser->setPlainPassword('mypassword');
$emptyUser->setEnabled(true);
$manager->persist($emptyUser);
$this->addReference('empty-user', $emptyUser);
$manager->flush();
}