本文整理汇总了PHP中Mockery::close方法的典型用法代码示例。如果您正苦于以下问题:PHP Mockery::close方法的具体用法?PHP Mockery::close怎么用?PHP Mockery::close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mockery
的用法示例。
在下文中一共展示了Mockery::close方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
/**
* @inheritdoc
*/
protected function tearDown()
{
$this->mockSocket = null;
$this->mockFactory = null;
m::close();
parent::tearDown();
}
示例2: tearDown
public function tearDown()
{
if ($this->db) {
$this->db->drop();
}
m::close();
}
示例3: tearDown
public function tearDown()
{
unset($data);
unset($model);
Mockery::close();
Artisan::call('migrate:rollback');
}
示例4: tearDown
/**
* Remove all mock objects
*/
public function tearDown()
{
unset($this->userManager);
unset($this->authenticationManager);
unset($this->commandTester);
m::close();
}
示例5: tearDown
public function tearDown()
{
parent::tearDown();
$this->allowMockingNonExistentMethods(true);
// Verify Mockery expectations.
Mock::close();
}
示例6: tearDown
/**
* Tear down test env
*
* @return void
* @author Dan Cox
*/
public function tearDown()
{
m::close();
if (!is_null($this->DI)) {
$this->DI->clearMocks();
}
}
示例7: tearDown
public function tearDown()
{
parent::tearDown();
m::close();
(new \UsersCreateTable())->down();
Facades\Schema::drop('password_reminders');
}
示例8: teardown
public function teardown()
{
m::close();
if ($this->useDatabase) {
$this->teardownDb();
}
}
示例9: tearDown
public function tearDown()
{
exec('rm -rf ' . __DIR__ . '/output');
mkdir(__DIR__ . '/output');
touch(__DIR__ . '/output/.gitkeep');
Mockery::close();
}
示例10: tearDown
public function tearDown()
{
parent::tearDown();
Mockery::close();
Test::clean();
$this->dropDatabase();
}
示例11: tearDown
public function tearDown()
{
unset($this->mockFileSystem);
unset($this->iliosFileSystem);
unset($this->fakeTestFileDir);
m::close();
}
示例12: run
/**
* Runs the example
*
* @param \PHPSpec\Runner\Reporter $reporter
*/
public function run(Reporter $reporter)
{
try {
$methodName = $this->_methodName;
$startTime = microtime(true);
call_user_func(array($this->_exampleGroup, 'before'));
call_user_func(array($this->_exampleGroup, $methodName));
call_user_func(array($this->_exampleGroup, 'after'));
$endTime = microtime(true);
$this->_executionTime = $endTime - $startTime;
if (class_exists('Mockery')) {
\Mockery::close();
}
} catch (Failure $failure) {
$reporter->addFailure($this, $failure);
return;
} catch (Pending $pending) {
$reporter->addPending($this, $pending);
return;
} catch (Error $error) {
$reporter->addError($this, $error);
return;
} catch (\Exception $e) {
$reporter->addException($this, new Exception($e));
return;
}
$reporter->addPass($this);
}
示例13: canApplyInflections
/**
* @test
*/
public function canApplyInflections()
{
// Mocking argument resolver dependency.
$resolver = Mockery::mock(ArgumentResolver::class);
// Callback to be returned by ArgumentResolver::resolveArguments() method.
// Expects $arguments array to contain 'value' key to merge.
// Will return array of arguments for TestClass::setValue() method call.
$callback = function (array $arguments) {
return array_values(array_merge(['value' => 'to be replaced'], $arguments));
};
// Reflecting method to call on inflection.
$reflection = new ReflectionMethod(TestClass::class, 'setValue');
// Defining expectations.
$resolver->shouldReceive('reflectCallable')->with([TestClass::class, 'setValue'])->andReturn($reflection)->once();
$resolver->shouldReceive('resolveArguments')->with($reflection)->andReturn($callback)->once();
// Creating inflector, setting resolver, adding inflection.
$inflector = new ObjectInflector($resolver);
$inflector->addInflection(TestClass::class, 'setValue', ['value' => 'value']);
// Creating test object.
$test = new TestClass(new stdClass());
// At first value is empty.
$this->assertNull($test->getValue());
// Applying inflections.
$inflector->applyInflections($test);
// Now value was changed via TestClass::setValue() call.
$this->assertSame('value', $test->getValue());
// After first run inflection callable must be saved for better performance.
$test2 = new TestClass(new stdClass());
$inflector->applyInflections($test2);
$this->assertSame($test->getValue(), $test2->getValue());
// Inflection must be called only on TestClass instances.
$inflector->applyInflections(Mockery::mock(stdClass::class)->shouldNotReceive('setValue')->getMock());
Mockery::close();
}
示例14: tearDown
protected function tearDown()
{
\Mockery::close();
$this->obj = null;
$this->atts = null;
$this->q = null;
}
示例15: _after
protected function _after()
{
m::close();
if (isset($this->model)) {
unset($this->model);
}
}