Rector extension for Mockery
You can also star (🌟) this repo to find it easier later.
You can install the package via composer:
composer require rector/rector --dev
composer require ghostwriter/mockery-rector --dev
To add a set to your config, and pick one of constants:
Ghostwriter\MockeryRector\MockeryRectorSetList
Ghostwriter\MockeryRector\MockeryRectorLevelSetList
use Ghostwriter\MockeryRector\MockeryLevelSetList;
use Ghostwriter\MockeryRector\MockerySetList;
use Ghostwriter\MockeryRector\Rule\ExtendMockeryTestCaseRector;
use Ghostwriter\MockeryRector\Rule\HamcrestToPHPUnitRector;
use Ghostwriter\MockeryRector\Rule\PHPUnitToMockeryRector;
use Ghostwriter\MockeryRector\Rule\ProphecyToMockeryRector;
use Ghostwriter\MockeryRector\Rule\ShouldReceiveToAllowsRector;
use Ghostwriter\MockeryRector\Rule\ShouldReceiveToExpectsRector;
use Ghostwriter\MockeryRector\Rule\UseMockeryPHPUnitIntegrationTraitRector;
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withRules([
// ExtendMockeryTestCaseRector::class,
// HamcrestToPHPUnitRector::class,
// PHPUnitToMockeryRector::class,
// ProphecyToMockeryRector::class,
// ShouldReceiveToAllowsRector::class,
// ShouldReceiveToExpectsRector::class,
// UseMockeryPHPUnitIntegrationTraitRector::class,
])
->withSets([
// version sets
MockerySetList::MOCKERY_1_6, // v1.6.0
MockerySetList::MOCKERY_2_0, // v2.0.0
// or level sets
MockeryLevelSetList::UP_TO_MOCKERY_1_6, // v0.1.0 - v1.6.0
MockeryLevelSetList::UP_TO_MOCKERY_2_0, // v0.1.0 - v2.0.0
// or migration sets
MockerySetList::PHPUNIT_TO_MOCKERY, // PHPUnit to Mockery
MockerySetList::PROPHECY_TO_MOCKERY, // Prophecy to Mockery
]);
To see all the rules, check the docs/rector_rules_overview.md file.
Please see CHANGELOG.md for more information on what has changed recently.
Please see LICENSE for more information on the license that applies to this project.
Please see SECURITY.md for more information on security disclosure process.