CodeceptionUtilAutoload

Codeception\Util\Autoload

Autoloader, which is fully compatible with PSR-4, and can be used to autoload your Helper, Page, and Step classes.

__construct()

private __construct()

See source

addNamespace()

public static addNamespace($prefix, $base_dir, $prepend = null)

Adds a base directory for a namespace prefix.

Example:

<?php
// app\Codeception\UserHelper will be loaded from '/path/to/helpers/UserHelper.php'
Autoload::addNamespace('app\Codeception', '/path/to/helpers');

// LoginPage will be loaded from '/path/to/pageobjects/LoginPage.php'
Autoload::addNamespace('', '/path/to/pageobjects');

Autoload::addNamespace('app\Codeception', '/path/to/controllers');
?>
  • param string $prefix The namespace prefix.
  • param string $base_dir A base directory for class files in the namespace.
  • param bool $prepend If true, prepend the base directory to the stack instead of appending it; this causes it to be searched first rather than last.
  • return void

See source

load()

public static load($class)

See source

loadMappedFile()

protected static loadMappedFile($prefix, $relative_class)

Load the mapped file for a namespace prefix and relative class.

  • param string $prefix The namespace prefix.
  • param string $relative_class The relative class name.
  • return mixed Boolean false if no mapped file can be loaded, or the name of the mapped file that was loaded.

See source

register()

public static register($namespace, $suffix, $path)

  • deprecated Use self::addNamespace() instead.

See source

registerSuffix()

public static registerSuffix($suffix, $path)

  • deprecated Use self::addNamespace() instead.

See source

requireFile()

protected static requireFile($file)

See source

© 2011–2017 Michael Bodnarchuk and contributors
Licensed under the MIT License.
http://codeception.com/docs/reference/Autoload

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部