Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

Commit

Permalink
Address some SL Insight issues
Browse files Browse the repository at this point in the history
* Move HautelookAliceBundle configuration in dev configuration as is a dev bundle
* Move CsaGuzzleBundle to production bundle as is used in production mode
* Removed SenioLabsGeneratorBundle
* Moved tests of UserBundle to the test folder as was no longer executed in src
* Remove web/config.php file from StyleCI inspection as will raise warning at each
 composer update
* Passed theofidry/alice-bundle-extension to stable
* Moved PHPUnit related source code to tests/PHPUnit
  • Loading branch information
theofidry committed Oct 10, 2015
1 parent 3789655 commit 4b39b0a
Show file tree
Hide file tree
Showing 16 changed files with 107 additions and 117 deletions.
1 change: 1 addition & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ finder:
- app/autoload.php
- app/autoload.php.cache
- app/SymfonyRequirements.php
- web/config.php
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
- PATH="$HOME/.composer/vendor/bin:$PATH"
- GITHUB_PAGES_COMMIT_MESSAGE="Rebuild pages at $(git rev-parse --short HEAD)"
- if [[ -z "$GITHUB_PAGES_TOKEN" ]]; then
then GITHUB_PAGES_REMOTE="https://user:${GITHUB_PAGES_TOKEN}@github.com/in6pio/Incipio.git";
GITHUB_PAGES_REMOTE="https://user:${GITHUB_PAGES_TOKEN}@github.com/in6pio/Incipio.git";
fi;
- GITHUB_USER_NAME="TravisBot"
- GITHUB_USER_EMAIL="[email protected]"
Expand Down
3 changes: 1 addition & 2 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function registerBundles()
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),

new Csa\Bundle\GuzzleBundle\CsaGuzzleBundle(),
new Dunglas\ApiBundle\DunglasApiBundle(),
new Fidry\LoopBackApiBundle\LoopBackApiBundle(),
new FOS\HttpCacheBundle\FOSHttpCacheBundle(),
Expand All @@ -41,10 +42,8 @@ public function registerBundles()
];

if (in_array($this->getEnvironment(), ['dev', 'test'])) {
$bundles[] = new Csa\Bundle\GuzzleBundle\CsaGuzzleBundle();
$bundles[] = new Hautelook\AliceBundle\HautelookAliceBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
}
Expand Down
9 changes: 1 addition & 8 deletions app/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ imports:
- { resource: security.yml }

framework:
#esi: ~
translator: { fallbacks: ["%locale%"] }
secret: %secret%
router:
Expand Down Expand Up @@ -64,14 +63,8 @@ fos_user:
user_manager: api.entity_manager.user_manager
user_class: ApiBundle\Entity\User

# AliceBundle
hautelook_alice:
locale: %locale%
seed: %seed%

# KnpMenuBundle
knp_menu:
# use "twig: false" to disable the Twig extension and the TwigRenderer
twig:
template: knp_menu.html.twig
templating: false
Expand Down Expand Up @@ -114,7 +107,7 @@ stof_doctrine_extensions:
default:
timestampable: true

# Swiftmailer
# Swift Mailer
swiftmailer:
transport: %mailer_transport%
host: %mailer_host%
Expand Down
13 changes: 10 additions & 3 deletions app/config/config_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ framework:
strict_requirements: true
profiler: { only_exceptions: false }

web_profiler:
toolbar: true
intercept_redirects: false
# AliceBundle
hautelook_alice:
locale: %locale%
seed: %seed%

# Monolog
monolog:
handlers:
main:
Expand All @@ -32,3 +34,8 @@ monolog:
VERBOSITY_VERY_VERBOSE: NOTICE
VERBOSITY_DEBUG: DEBUG
channels: [ doctrine ]

# Web Profiler
web_profiler:
toolbar: true
intercept_redirects: false
11 changes: 8 additions & 3 deletions app/config/config_prod.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
imports:
- { resource: config.yml }

# TODO: active it once the cache will have been configured
#framework:
# validation:
# cache: validator.mapping.cache.apc
# serializer:
# cache: serializer.mapping.cache.apc

# TODO: active it once the cache will have been configured
#dunglas_json_ld_api:
# cache: dunglas_json_ld_api.mapping.cache.apc

# TODO: active it once the cache will have been configured
#doctrine:
# orm:
# metadata_cache_driver: apc
# result_cache_driver: apc
# query_cache_driver: apc

# Monolog
monolog:
handlers:
main:
Expand All @@ -29,6 +33,7 @@ monolog:
console:
type: console

nelmio_api_doc:
cache:
enabled: true
# TODO: active it once the issue with nelmio api doc and DunglasApiBundle has been resolved
#nelmio_api_doc:
# cache:
# enabled: true
3 changes: 3 additions & 0 deletions app/config/config_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ doctrine:
dbal:
dbname: %database_name%

# Doctrine Extensions
stof_doctrine_extensions:
class:
# Overrides Timestampable listener to set fix values for createAt and updatedAt dates to ease the testing
Expand All @@ -21,9 +22,11 @@ stof_doctrine_extensions:
default:
timestampable: true

# SwiftMailer
swiftmailer:
disable_delivery: true

# Web Profiler
web_profiler:
toolbar: false
intercept_redirects: false
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "in6pio/Incipio",
"name": "in6pio/incipio",
"description": "ERP for Junior-Entreprises.",
"license": "GNU",
"license": "AGPL-3.0",
"type": "project",
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -50,10 +50,9 @@
"doctrine/data-fixtures": "^1.1",
"hautelook/alice-bundle": "~1.0",
"phpunit/phpunit": "^5.0",
"sensio/generator-bundle": "~2.3",
"sllh/php-cs-fixer-styleci-bridge": "^1.3",
"symfony/phpunit-bridge": "~2.7",
"theofidry/alice-bundle-extension": "~1.0@beta"
"theofidry/alice-bundle-extension": "~1.0"
},
"scripts": {
"style:check": "php bin/php-cs-fixer fix -n --dry-run --diff -v --ansi src && php bin/php-cs-fixer fix -n --dry-run --diff -v --ansi features ",
Expand Down
55 changes: 3 additions & 52 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions src/.htaccess

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,18 @@
* file that was distributed with this source code.
*/

namespace ApiBundle\Test\Entity;
namespace PHPUnit\Framework;

use ApiBundle\Test\FluentTestCaseInterface;
use Doctrine\ORM\Tools\SchemaTool;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\PropertyAccess\StringUtil;

/**
* Class EntityTestCase: test case for entities.
*
* @link http://en.wikipedia.org/wiki/Fluent_interface
* Base class for entity tests.
*
* @author Théo FIDRY <[email protected]>
*/
abstract class AbstractEntityTestCase extends KernelTestCase implements FluentTestCaseInterface
abstract class AbstractEntityTestCase extends KernelTestCase implements EntityTestCaseInterface
{
/**
* @var \Doctrine\Bundle\DoctrineBundle\Registry
Expand Down Expand Up @@ -59,7 +56,7 @@ public function setUp()
}

/**
* @return string Tested entity FQCN
* {@inheritdoc}
*/
abstract public function getEntityClassName();

Expand Down Expand Up @@ -106,36 +103,18 @@ public function testFluentImplementation(array $data = [])
}
}

/**
* @testdox Test the entity property accessors (getters, setters, hassers, issers).
*
* @param array $data
*/
abstract public function testPropertyAccessors(array $data = []);

/**
* Ensure that when the entity is deleted, the relations are properly unset.
*
* @coversNothing
*
* @param array $data
*
* @return
*/
abstract public function testDeleteEntity(array $data = []);

/**
* @return array Optimal set of data for generating a complete entity.
*/
abstract public function fluentDataProvider();

/**
* @testdox Test the model validation constraints with valid data.
* {@inheritdoc}
*
* @coversNothing
* @dataProvider validDataProvider
*/
public function testValidationConstraintsWithValidData($data, $groups = null)
public function testValidationConstraintsWithValidData(array $data, $groups = null)
{
$reflClass = new \ReflectionClass($this->getEntityClassName());
$entity = $reflClass->newInstanceArgs($data);
Expand All @@ -144,12 +123,12 @@ public function testValidationConstraintsWithValidData($data, $groups = null)
}

/**
* @testdox Test the model validation constraints with invalid data.
* {@inheritdoc}
*
* @coversNothing
* @dataProvider invalidDataProvider
*/
public function testValidationConstraintsWithInvalidData($data, $groups = null)
public function testValidationConstraintsWithInvalidData(array $data, $groups = null)
{
$reflClass = new \ReflectionClass($this->getEntityClassName());
$entity = $reflClass->newInstanceArgs($data);
Expand All @@ -170,7 +149,7 @@ abstract public function validDataProvider();
abstract public function invalidDataProvider();

/**
* Camelizes a given string.
* Will camelize a given string.
*
* @see \Symfony\Component\PropertyAccessor::camelize()
*
Expand Down
Loading

0 comments on commit 4b39b0a

Please sign in to comment.