sqlexception / magento2-utils
There is no license information available for the latest version (dev-master) of this package.
Package info
github.com/sqlexception/magento2-utils
Type:magento2-module
pkg:composer/sqlexception/magento2-utils
dev-master
2019-11-05 10:22 UTC
Requires
- php: ~7.1.3||~7.2.0||~7.3.0
- magento/magento-composer-installer: *
This package is auto-updated.
Last update: 2026-04-06 01:11:16 UTC
README
A set of Magento utils to speed up development.
Installation within a Magento 2 project
To use within your Magento 2 project you can use:
composer require sqlexception/magento2-utils "dev-master as 1.0.0" --prefer-source --ignore-platform-reqs
Usage
Once installed, you can run ...
Module Config integration test
<?php namespace Demo\Module\Test\Integration; use SqlException\Utils\Test\Integration\Traits\ModuleConfigTestTrait; /** * Class ModuleConfigTest * * @package Demo\Module\Test\Integration */ class ModuleConfigTest extends \PHPUnit\Framework\TestCase { /** * @var string current module name to test */ public static $moduleName = 'Demo_Module'; use ModuleConfigTestTrait; // your custom tests }
Crontab Config integration test
<?php namespace Demo\Module\Test\Integration\Cron\Crontab; use SqlException\Utils\Test\Integration\Traits\CrontabConfigTestTrait; use Demo\Module\Cron\Sample; /** * Class SampleCrontabConfigTest * * @package Demo\Module\Test\Integration\Cron\Crontab */ class SampleCrontabConfigTest extends \PHPUnit\Framework\TestCase { public static $jobGroup = 'custom_or_default'; public static $jobName = 'sample_cron_job'; public static $jobInstance = Sample::class; public static $jobMethod = 'execute'; use CrontabConfigTestTrait; // your custom tests }
Command Config integration test
<?php declare(strict_types = 1); namespace Demo\Module\Test\Integration\Console\Command; use SqlException\Utils\Test\Integration\Traits\CommandConfigTestTrait; use Demo\Module\Console\Command\Sample; /** * Class SampleCommandTest * * @package Demo\Module\Test\Integration\Console\Command */ class SampleCommandConfigTest extends \PHPUnit\Framework\TestCase { public static $commandCode = 'demo_sample_command'; public static $commandName = 'demo:sample'; public static $commandDescription = 'Run sample command.'; public static $commandClass = Sample::class; use CommandConfigTestTrait; // your custom tests }