factory() public static method

Static method to instantiate the autoloader object
public static factory ( boolean $self = true ) : Autoloader
$self boolean
return Autoloader
Example #1
0
 public function testAutoloader()
 {
     $a = new Autoloader();
     $a->splAutoloadRegister();
     $this->assertInstanceOf('Pop\\Loader\\Autoloader', $a);
     $this->assertInstanceOf('Pop\\Loader\\Autoloader', Autoloader::factory());
 }
Example #2
0
 * @author     Nick Sagona, III <*****@*****.**>
 * @copyright  Copyright (c) 2009-2014 Moc 10 Media, LLC. (http://www.moc10media.com)
 * @license    http://www.popphp.org/license     New BSD License
 */
/**
 * @namespace
 */
namespace Pop;

use Pop\Loader\Autoloader;
use Pop\Filter\String;
use Pop\Validator;
// Require the library's autoloader.
require_once __DIR__ . '/../../../src/Pop/Loader/Autoloader.php';
// Call the autoloader's bootstrap function.
Autoloader::factory()->splAutoloadRegister();
class StringTest extends \PHPUnit_Framework_TestCase
{
    public $string = 'Hello World';
    public $key = '123456789';
    public function testString()
    {
        $this->assertEquals('hello-world', String::camelCaseToDash('HelloWorld'));
        $this->assertEquals('hello_world', String::camelCaseToUnderscore('HelloWorld'));
        $this->assertEquals('helloWorld', String::dashToCamelCase('hello-world'));
        $this->assertEquals('hello_world', String::dashToUnderscore('hello-world'));
    }
    public function testStringRandom()
    {
        $s = String::random(6);
        $this->assertEquals(6, strlen($s));