1<?php 2// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project 3// 4// All Rights Reserved. See copyright.txt for details and a complete list of authors. 5// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. 6// $Id$ 7 8class Reports_FactoryTest extends TikiTestCase 9{ 10 public function testBuild_shouldReturnInstances() 11 { 12 $classes = ['Reports_Users', 'Reports_Cache', 'Reports_Manager', 'Reports_Send']; 13 14 foreach ($classes as $className) { 15 $this->assertInstanceOf($className, Reports_Factory::build($className)); 16 } 17 } 18 19 public function testBuild_shouldThrowExceptionForUnknownClass() 20 { 21 $this->setExpectedException('Exception', 'Unknown class Unknown_Class'); 22 Reports_Factory::build('Unknown_Class'); 23 } 24} 25