public function testStaticFactoryReturnsObjectWithParams() { // the return value from the find $collectionName = 'users'; $userData = $this->getUserData(); unset($userData['_id']); $this->connectionMock->expects($this->never())->method('insert'); $user = UserUnit::factory($userData); $this->assertTrue($user instanceof UserUnit); }