示例#1
0
 /**
  * Test extensions
  */
 public function testExtensions()
 {
     $loader = new \Phalcon\Loader();
     $this->assertException(array($loader, 'setExtensions'), array('php'), 'Phalcon\\Loader\\Exception');
     $this->assertEquals($loader->getExtensions(), array('php'));
     $loader->setExtensions(array('php', 'inc'));
     $this->assertEquals($loader->getExtensions(), array('php', 'inc'));
 }
示例#2
0
 public function testDirectoriesExtensions()
 {
     $loader = new Phalcon\Loader();
     $loader->setExtensions(array('inc', 'php'));
     $loader->registerDirs(array("unit-tests/vendor/example/dialects/", "unit-tests/vendor/example/types/", "unit-tests/vendor/"));
     $loader->register();
     $leSome = new \example\adapter\LeAnotherSome();
     $this->assertEquals(get_class($leSome), 'Example\\Adapter\\LeAnotherSome');
     $loader->unregister();
 }
示例#3
0
<?php

// Creates the autoloader
$loader = new \Phalcon\Loader();
//Set file extensions to check
$loader->setExtensions(array("php", "inc", "phb"));