PHP code example of sbuerk / fixture-packages

1. Go to this page and download the library: Download sbuerk/fixture-packages library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sbuerk / fixture-packages example snippets


/**
 * Automatically add fixture extensions to the `typo3/testing-framework`
 * {@see \TYPO3\TestingFramework\Composer\ComposerPackageManager} to
 * allow composer package name or extension keys of fixture extension in
 * {@see \TYPO3\TestingFramework\Core\Functional\FunctionalTestCase::$testExtensionToLoad}.
 */
if (class_exists(\SBUERK\AvailableFixturePackages::class)) {
    (new \SBUERK\AvailableFixturePackages())->adoptFixtureExtensions();
}

 
/*
 * This file is part of the TYPO3 CMS project.
 *
 * It is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License, either version 2
 * of the License, or any later version.
 *
 * For the full copyright and license information, please read the
 * LICENSE.txt file that was distributed with this source code.
 *
 * The TYPO3 project - inspiring people to share!
 */

/**
 * Boilerplate for a functional test phpunit boostrap file.
 *
 * This file is loosely maintained within TYPO3 testing-framework, extensions
 * are encouraged to not use it directly, but to copy it to an own place,
 * usually in parallel to a FunctionalTests.xml file.
 *
 * This file is defined in FunctionalTests.xml and called by phpunit
 * before instantiating the test suites.
 */
(static function () {

    /**
     * Automatically add fixture extensions to the `typo3/testing-framework`
     * {@see \TYPO3\TestingFramework\Composer\ComposerPackageManager} to
     * allow composer package name or extension keys of fixture extension in
     * {@see \TYPO3\TestingFramework\Core\Functional\FunctionalTestCase::$testExtensionToLoad}.
     */
    if (class_exists(\SBUERK\AvailableFixturePackages::class)) {
        (new \SBUERK\AvailableFixturePackages())->adoptFixtureExtensions();
    }

    $testbase = new \TYPO3\TestingFramework\Core\Testbase();
    $testbase->defineOriginalRootPath();
    $testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/tests');
    $testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/transient');
})();



declare(strict_types=1);

/*
 * This file is part of the TYPO3 CMS project.
 *
 * It is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License, either version 2
 * of the License, or any later version.
 *
 * For the full copyright and license information, please read the
 * LICENSE.txt file that was distributed with this source code.
 *
 * The TYPO3 project - inspiring people to share!
 */

namespace Vendor\MyExtension\Tests\Functional;

final class DummyTest extends FunctionalTestCase
{
    protected array $testExtensionToLoad = [
        'vendor/fixture-extension',
        'vendor/root-package',
    ];
}

    protected array $testExtensionToLoad = [
        __DIR__ . '/Fixtures/Extensions/fixture-extension',        
        'vendor/root-package',
    ];