-
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.
Merge pull request #1 from yethee/default-config
Added ability to use the bundle with default config
- Loading branch information
Showing
5 changed files
with
88 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,4 @@ | ||
# Cache and logs (Symfony2) | ||
/app/cache/* | ||
/app/logs/* | ||
!app/cache/.gitkeep | ||
!app/logs/.gitkeep | ||
|
||
# Cache and logs (Symfony3) | ||
/var/cache/* | ||
/var/logs/* | ||
!var/cache/.gitkeep | ||
!var/logs/.gitkeep | ||
|
||
# Parameters | ||
/app/config/parameters.yml | ||
/app/config/parameters.ini | ||
|
||
# Managed by Composer | ||
/app/bootstrap.php.cache | ||
/var/bootstrap.php.cache | ||
/bin/* | ||
!bin/console | ||
!bin/symfony_requirements | ||
/vendor/ | ||
|
||
# Assets and user uploads | ||
/web/bundles/ | ||
/web/uploads/ | ||
|
||
# PHPUnit | ||
/app/phpunit.xml | ||
/phpunit.xml | ||
|
||
# Build data | ||
/build/ | ||
|
||
# Composer PHAR | ||
/composer.phar | ||
/composer.lock | ||
/phpunit.xml |
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
62 changes: 62 additions & 0 deletions
62
Tests/DependencyInjection/Ju1iusWebpackAssetsExtensionTest.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,62 @@ | ||
<?php | ||
|
||
namespace ju1ius\WebpackAssetsBundle\Tests\DependencyInjection; | ||
|
||
use ju1ius\WebpackAssetsBundle\DependencyInjection\Ju1iusWebpackAssetsExtension; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
|
||
class Ju1iusWebpackAssetsExtensionTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @var ContainerBuilder; | ||
*/ | ||
private $container; | ||
|
||
/** | ||
* @var Ju1iusWebpackAssetsExtension; | ||
*/ | ||
private $extension; | ||
|
||
public function testLoadWithDefaults() | ||
{ | ||
$this->extension->load(array(), $this->container); | ||
|
||
$this->assertTrue($this->container->hasDefinition('ju1ius_webpack_assets.asset_helper')); | ||
$this->assertEquals( | ||
array( | ||
'%kernel.root_dir%/../webpack-assets.json' | ||
), | ||
$this->container->getDefinition('ju1ius_webpack_assets.asset_helper')->getArguments() | ||
); | ||
} | ||
|
||
public function testLoadWithCustomConfig() | ||
{ | ||
$this->extension->load( | ||
array( | ||
'ju1ius_webpack_assets' => array( | ||
'revision_manifest' => 'rev-manifest.json' | ||
) | ||
), | ||
$this->container | ||
); | ||
|
||
$this->assertEquals( | ||
array( | ||
'rev-manifest.json' | ||
), | ||
$this->container->getDefinition('ju1ius_webpack_assets.asset_helper')->getArguments() | ||
); | ||
} | ||
|
||
protected function setUp() | ||
{ | ||
$this->container = new ContainerBuilder(); | ||
$this->extension = new Ju1iusWebpackAssetsExtension(); | ||
} | ||
|
||
protected function tearDown() | ||
{ | ||
unset($this->container, $this->extension); | ||
} | ||
} |
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,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit bootstrap="vendor/autoload.php" colors="true"> | ||
<testsuites> | ||
<testsuite name="Ju1iusWebpackAssetsBundle"> | ||
<directory>./Tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory>.</directory> | ||
<exclude> | ||
<directory>./Resources</directory> | ||
<directory>./Tests</directory> | ||
<directory>./vendor</directory> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |