You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1) PageTest::testPageHasOnePage
Mockery\Exception\NoMatchingExpectationException: No matching handler found for page::hasOne("Page",
"parent_id"). Either the method was unexpected or its arguments matched no expected argument list for this method
C:\wamp\www\squigglemd\vendor\mockery\mockery\library\Mockery\ExpectationDirector.php:93
C:\wamp\www\squigglemd\app\models\Page.php:18
C:\wamp\www\squigglemd\vendor\way\laravel-test-helpers\src\Way\Tests\ModelHelpers.php:59
C:\wamp\www\squigglemd\vendor\way\laravel-test-helpers\src\Way\Tests\ModelHelpers.php:36
C:\wamp\www\squigglemd\app\tests\PageTest.php:34
For the following model:
class Page extends Post {
protected $guarded = array();
protected $table = 'pages';
public static $rules = array(
'slug' => 'required|unique:posts',
'title' => 'required',
'user_id' => 'required|integer',
'parent_id' => 'required|integer',
'order' => 'required|integer'
);
public function pages()
{
return $this->hasOne('Page', 'parent_id');
}
}
I also have this issue. It appears to come from Mockery only expecting one piece of information back, however I have no idea how to add "optional withs" to mockery which I imagine would possible fix it.
Below is the error I get.
For the following model:
And the test code:
It passes when I remove the parent_id from the hasOne relationship.
The text was updated successfully, but these errors were encountered: