FactoryException.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Cache
  17. * @subpackage UnitTests
  18. * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. require_once 'PHPUnit/Extensions/ExceptionTestCase.php';
  23. require_once 'Zend/Cache.php';
  24. /**
  25. * @category Zend
  26. * @package Zend_Cache
  27. * @subpackage UnitTests
  28. * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
  29. * @license http://framework.zend.com/license/new-bsd New BSD License
  30. */
  31. class Zend_Cache_FactoryException extends PHPUnit_Extensions_ExceptionTestCase
  32. {
  33. function setUp(){
  34. $this->setExpectedException('Zend_Cache_Exception');
  35. }
  36. public function testBadFrontend()
  37. {
  38. Zend_Cache::factory('badFrontend', 'File');
  39. }
  40. public function testBadBackend()
  41. {
  42. Zend_Cache::factory('Output', 'badBackend');
  43. }
  44. public function testFrontendBadParam()
  45. {
  46. Zend_Cache::factory('badFrontend', 'File', array('badParam'=>true));
  47. }
  48. public function testBackendBadParam()
  49. {
  50. Zend_Cache::factory('Output', 'badBackend', array(), array('badParam'=>true));
  51. }
  52. public function testThrowMethod()
  53. {
  54. Zend_Cache::throwException('test');
  55. }
  56. }