ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
AutoloaderTest.php
Go to the documentation of this file.
1 <?php
2 
3 
5 {
6 
7  public function setUp()
8  {
9  if (!defined('PHPEXCEL_ROOT'))
10  {
11  define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
12  }
13  require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
14  }
15 
17  {
18  $className = 'InvalidClass';
19 
20  $result = PHPExcel_Autoloader::Load($className);
21  // Must return a boolean...
22  $this->assertTrue(is_bool($result));
23  // ... indicating failure
24  $this->assertFalse($result);
25  }
26 
28  {
29  $className = 'PHPExcel_Invalid_Class';
30 
31  $result = PHPExcel_Autoloader::Load($className);
32  // Must return a boolean...
33  $this->assertTrue(is_bool($result));
34  // ... indicating failure
35  $this->assertFalse($result);
36  }
37 
39  {
40  $className = 'PHPExcel_IOFactory';
41 
42  $result = PHPExcel_Autoloader::Load($className);
43  // Check that class has been loaded
44  $this->assertTrue(class_exists($className));
45  }
46 
48  {
50  // Must return an object...
51  $this->assertTrue(is_object($result));
52  // ... of the correct type
53  $this->assertTrue(is_a($result,'PHPExcel_Calculation_Function'));
54  }
55 
56 }
$result
testAutoloadInstantiateSuccess()
testAutoloaderInvalidPHPExcelClass()
testAutoloadValidPHPExcelClass()
static Load($pClassName)
Autoload a class identified by name.
Definition: Autoloader.php:71
testAutoloaderNonPHPExcelClass()
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27