Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MockEnvironment extends Mock to be usable with MockDisabler. #6

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions classes/MockEnvironment.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
* @link bitcoin:1335STSwu9hST4vcMRppEPgENMHD2r1REK Donations
* @license http://www.wtfpl.net/txt/copying/ WTFPL
*/
class MockEnvironment
class MockEnvironment extends Mock
{

/**
* @var Mock[] Mock environment.
*/
private $mocks = [];

/**
* Sets the mocks for this environment.
*
Expand All @@ -26,7 +26,7 @@ public function __construct(array $mocks = [])
{
$this->mocks = $mocks;
}

/**
* Adds a mock to this environment.
*
Expand All @@ -36,26 +36,26 @@ public function addMock(Mock $mock)
{
$this->mocks[] = $mock;
}

/**
* Enable all mocks in this environment.
*/
public function enable()
{
foreach ($this->mocks as $mock) {
$mock->enable();

}
}

/**
* Disable all mocks in this environment.
*/
public function disable()
{
foreach ($this->mocks as $mock) {
$mock->disable();

}
}
}