Example #1
0
 /**
  * @group core
  */
 public function testLoadAllTests()
 {
     Codeception\Util\Autoload::addNamespace('Math', codecept_data_dir() . 'claypit/tests/_support/Math');
     // to autoload dependencies
     $this->testLoader = new \Codeception\Test\Loader(['path' => codecept_data_dir() . 'claypit/tests']);
     $this->testLoader->loadTests();
     $testNames = $this->getTestNames($this->testLoader->getTests());
     $this->assertContainsTestName('AnotherCept', $testNames);
     $this->assertContainsTestName('MageGuildCest:darkPower', $testNames);
     $this->assertContainsTestName('FailingTest:testMe', $testNames);
     $this->assertContainsTestName('MathCest:testAddition', $testNames);
     $this->assertContainsTestName('MathTest:testAll', $testNames);
 }
<?php

/**
 * @file Global bootstrap for all codeception tests
 */
/**
 * Set up global data passed in from the config file
 *
 * @param array $config The CodeCeption config array
 */
function tribe_events_codeception_bootstrap($config)
{
    if (isset($config['php']['constants']) && is_array($config['php']['constants'])) {
        foreach ($config['php']['constants'] as $key => $value) {
            if (!defined($key)) {
                define($key, $value);
            }
        }
    }
    if (isset($config['php']['globals']) && is_array($config['php']['globals'])) {
        foreach ($config['php']['globals'] as $key => $value) {
            $GLOBALS[$key] = $value;
        }
    }
}
Codeception\Util\Autoload::registerSuffix('Tribe__Events__WP_UnitTestCase', __DIR__ . '/helpers');
tribe_events_codeception_bootstrap(\Codeception\Configuration::config());
<?php

// Here you can initialize variables that will be available to your tests
Codeception\Util\Autoload::registerSuffix('Steps', __DIR__ . DIRECTORY_SEPARATOR . '_steps');
<?php

// This is global bootstrap for autoloading
Codeception\Util\Autoload::addNamespace('Tribe__Events__WP_UnitTestCase', __DIR__ . '/_support');
Codeception\Util\Autoload::addNamespace('Tribe\\Events\\Test', __DIR__ . '/_support');
Codeception\Util\Autoload::addNamespace('Tribe\\Events\\Test\\Acceptance\\Steps', __DIR__ . '/acceptance/_steps');
Example #5
0
<?php

// This is global bootstrap for autoloading
Codeception\Util\Autoload::register('', '', __DIR__ . '/../app/classes/');
<?php

// This is global bootstrap for autoloading
Codeception\Util\Autoload::register('Etki\\Composer\\Installers\\Opencart\\Tests\\Support', '', __DIR__ . DIRECTORY_SEPARATOR . '_support');
<?php

/**
 * @file Global bootstrap for all codeception tests
 */
Codeception\Util\Autoload::addNamespace('Tribe__Events__WP_UnitTestCase', __DIR__ . '/_support');
Codeception\Util\Autoload::addNamespace('Tribe\\Events\\Test', __DIR__ . '/_support');
Example #8
0
<?php

require_once __DIR__ . '/../vendor/autoload.php';
Codeception\Util\Autoload::register('Phalpro', 'Validator', __DIR__ . '/../src');