GaufretteServiceProviderTest.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /*
  3. * This file is part of GaufretteServiceProvider
  4. *
  5. * (c) Ben Tollakson <ben.tollakson@gmail.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace GaufretteServiceProvider\Tests;
  11. use Silex\Application;
  12. use Bt51\Silex\Provider\GaufretteServiceProvider\GaufretteServiceProvider;
  13. class GaufretteServiceProviderTest extends \PHPUnit_Framework_TestCase
  14. {
  15. public function setUp()
  16. {
  17. if (!class_exists('Gaufrette\\Filesystem')) {
  18. $this->markTestSkipped('Gaufrette is not installed');
  19. }
  20. }
  21. public function testSilexGaufrette()
  22. {
  23. $app = new Application();
  24. $app->register(new GaufretteServiceProvider(),
  25. array('gaufrette.adapter.class' => 'InMemory'));
  26. $app->boot();
  27. $this->assertInstanceOf('\\Gaufrette\\Filesystem', $app['gaufrette.filesystem']);
  28. }
  29. public function testGaufretteCache()
  30. {
  31. $app = new Application();
  32. $app->register(new GaufretteServiceProvider(),
  33. array('gaufrette.adapter.class' => 'InMemory',
  34. 'gaufrette.adapter.cache.class' => 'Local',
  35. 'gaufrette.cache.options' => array(__DIR__ . '/cache')));
  36. $app->boot();
  37. $this->assertInstanceOf('\\Gaufrette\\Adapter\\Cache', $app['gaufrette.cache']);
  38. }
  39. }