Skip to content

Commit cad07e9

Browse files
authored
Revert "Add expects to built-in Facade testing methods (#34932)" (#34934)
This reverts commit 4fc9579.
1 parent 4fc9579 commit cad07e9

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

src/Illuminate/Support/Facades/Facade.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,6 @@ public static function shouldReceive()
9090
return $mock->shouldReceive(...func_get_args());
9191
}
9292

93-
/**
94-
* Initiate a mock expectation on the facade.
95-
*
96-
* @return \Mockery\Expectation
97-
*/
98-
public static function expects()
99-
{
100-
$name = static::getFacadeAccessor();
101-
102-
$mock = static::isMock()
103-
? static::$resolvedInstance[$name]
104-
: static::createFreshMockInstance();
105-
106-
return $mock->expects(...func_get_args());
107-
}
108-
10993
/**
11094
* Create a fresh mock instance for the given class.
11195
*

tests/Support/SupportFacadeTest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,6 @@ public function testCanBeMockedWithoutUnderlyingInstance()
7070
FacadeStub::shouldReceive('foo')->once()->andReturn('bar');
7171
$this->assertSame('bar', FacadeStub::foo());
7272
}
73-
74-
public function testExpectsReturnsAMockeryMockWithExpectationRequired()
75-
{
76-
$app = new ApplicationStub;
77-
$app->setAttributes(['foo' => new stdClass]);
78-
FacadeStub::setFacadeApplication($app);
79-
80-
$this->assertInstanceOf(MockInterface::class, $mock = FacadeStub::expects('foo')->with('bar')->andReturn('baz')->getMock());
81-
$this->assertSame('baz', $app['foo']->foo('bar'));
82-
}
8373
}
8474

8575
class FacadeStub extends Facade

0 commit comments

Comments
 (0)