vendor/codeages/biz-framework/src/Testing/BizCodeceptionModule.php

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php

namespace Codeages\Biz\Framework\Testing;

use Codeception\Module as CodeceptionModule;
use Codeception\Configuration;
use Codeages\Biz\Framework\Utility\Env;
use Codeages\Biz\Framework\Context\Biz;
use Codeception\Exception\ModuleRequireException;

class BizCodeceptionModule extends CodeceptionModule implements \Codeception\Lib\Interfaces\Db
{
    protected $bizConfig;

    /**
     * @var Biz
     */
    protected $biz;

    public $config = [
        'class' => '\Biz\AppBiz',
        'env_path' => 'env.testing.php',
        'config_path' => 'config/biz.php',
    ];

    public function _initialize()
    {
        $envFilePath = Configuration::projectDir().$this->config['env_path'];
        if (!file_exists($envFilePath)) {
            throw new ModuleRequireException(
                __CLASS__,
                "Biz env file not found in {$envFilePath} \n\n".
                "Please specify path to bootstrap file using `env_path` config option\n \n"
            );
        }
        Env::load(require $envFilePath);

        $bizConfigFilePath = Configuration::projectDir().$this->config['config_path'];
        if (!file_exists($bizConfigFilePath)) {
            throw new ModuleRequireException(
                __CLASS__,
                "Biz config file not found in {$bizConfigFilePath} \n\n".
                "Please specify path to bootstrap file using `config_path` config option\n \n"
            );
        }
        $this->bizConfig = require $bizConfigFilePath;

        if (!class_exists($this->config['class'])) {
            throw new ModuleRequireException(
                __CLASS__,
                "Biz class {$this->config['class']} \n\n".
                "Please specify biz class using `class` config option\n\n"
            );
        }
    }

    public function biz()
    {
        return $this->biz;
    }

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。