Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Warnar Boekkooi
committed
Jun 29, 2011
1 parent
cb7c355
commit 3371afb
Showing
1 changed file
with
47 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the FOSRestBundle package. | ||
* | ||
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace FOS\RestBundle\Tests\DependencyInjection; | ||
|
||
use Symfony\Component\Config\Definition\Processor; | ||
|
||
use FOS\RestBundle\DependencyInjection\Configuration; | ||
|
||
/** | ||
* FOSRestExtension test. | ||
* | ||
* @author Warnar Boekkooi <boekkooi> | ||
*/ | ||
class ConfigurationTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* Test that the formats that are Set to False or NULL aren't loaded. | ||
*/ | ||
public function testFormatsLoad() | ||
{ | ||
$configs = array( | ||
'fos_rest' => array( | ||
'formats' => array( | ||
'xml' => '\SomeClass', | ||
'html' => false, | ||
'json' => null | ||
) | ||
) | ||
); | ||
|
||
$processor = new Processor(); | ||
$configuration = new Configuration(); | ||
$config = $processor->processConfiguration($configuration, $configs); | ||
|
||
$this->assertEquals(1, count($config['formats'])); | ||
$this->assertArrayHasKey('xml', $config['formats']); | ||
} | ||
} |