testo/bridge-mockery package bridges Mockery (a PHP mocking library) with Testo (a lightweight PHP testing framework). This is valuable if the application relies on Testo for testing but requires Mockery for advanced mocking capabilities (e.g., partial mocks, mocking non-testable classes, or complex expectations).mockery/mockery directly may suffice.testo/testo) and Mockery (mockery/mockery) as dependencies.Testo\Bridge\Mockery\MockeryTestCase).testo/bridge-mockery and mockery/mockery to composer.json.Testo\Bridge\Mockery\MockeryTestCase:
use Testo\Bridge\Mockery\MockeryTestCase;
class MyTest extends MockeryTestCase {
public function testSomething() {
$mock = $this->mock('MyClass');
// Mockery methods...
}
}
$this->mockery->close()).composer.json for supported Mockery/Testo versions.Mockery::mock() vs. Testo\assert()).Mockery::close() or Mockery::disable().composer.json and run dependency checks:
composer require --dev testo/bridge-mockery mockery/mockery
mock() syntax and expectations.composer.json or use ^ cautiously:
"testo/bridge-mockery": "^1.0",
"mockery/mockery": "~2.0"
testo/bridge-mockery (even if inactive, forks or issues may emerge).Testo\Bridge\Mockery.shouldReceive() vs. shouldIgnore()).Mockery::close() in test teardown to avoid global state pollution.--show-unmockable flag to identify unmockable classes.--verbose flag for detailed test output.stub() vs. Mockery’s mock()).composer require --dev phpbench/phpbench
--parallel). Use --group or isolate mocks per test.// In setUp()
$this->mockery->disableOriginalClone();
How can I help you explore Laravel packages today?