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
public function setUp()
{
$this->FeedFactory = new \App\Test\Factory\PostFactory();
}
public function testSomething()
{
$post = $this->FeedFactory(1); // create a single record
$this->assertTrue(isset($post->id));
$this->FeedFactory(10); // create 10 records
}
fails with PHP Fatal error: Call to undefined method...
However, if I assign the "class variable" into a local variable like so:
public function testSomething()
{
$post = $this->FeedFactory; // create a single record
$post(1);
$this->assertTrue(isset($post->id));
$post(10); // create 10 records
}
it works
The text was updated successfully, but these errors were encountered:
fails with
PHP Fatal error: Call to undefined method...
However, if I assign the "class variable" into a local variable like so:
it works
The text was updated successfully, but these errors were encountered: