You are here

class AutoloadTest in One Click Upload 7.2

Autoload unit tests

@coversDefaultClass \Flow\Autoloader

@package Unit

Hierarchy

Expanded class hierarchy of AutoloadTest

File

flowphp/test/Unit/AutoloadTest.php, line 13

Namespace

Unit
View source
class AutoloadTest extends FlowUnitCase {

  /**
   * @covers ::__construct
   * @covers ::getDir
   */
  public function testAutoloader_construct_default() {
    $expDir = realpath(__DIR__ . '/../../src/Flow') . '/..';
    $autoloader = new \Flow\Autoloader();
    $this
      ->assertSame($expDir, $autoloader
      ->getDir());
  }

  /**
   * @covers ::__construct
   * @covers ::getDir
   */
  public function testAutoloader_construct_custom() {
    $expDir = __DIR__;
    $autoloader = new \Flow\Autoloader($expDir);
    $this
      ->assertSame($expDir, $autoloader
      ->getDir());
  }

  /**
   * @covers ::autoload
   */
  public function testClassesExist() {
    $autoloader = new \Flow\Autoloader();
    $autoloader
      ->autoload('noclass');
    $this
      ->assertFalse(class_exists('noclass', false));
    $autoloader
      ->autoload('Flow\\NoClass');
    $this
      ->assertFalse(class_exists('Flow\\NoClass', false));
    $autoloader
      ->autoload('Flow\\File');
    $this
      ->assertTrue(class_exists('Flow\\File'));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AutoloadTest::testAutoloader_construct_custom public function * @covers ::__construct * @covers ::getDir
AutoloadTest::testAutoloader_construct_default public function * @covers ::__construct * @covers ::getDir
AutoloadTest::testClassesExist public function * @covers ::autoload
FlowUnitCase::$filesArr protected property * $_FILES * *
FlowUnitCase::$requestArr protected property * Test request * *
FlowUnitCase::setUp protected function 3
FlowUnitCase::tearDown protected function