function CommentStatisticsUnitTest::fetchObjectCallback
Same name in other branches
- 9 core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php \Drupal\Tests\comment\Unit\CommentStatisticsUnitTest::fetchObjectCallback()
- 8.9.x core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php \Drupal\Tests\comment\Unit\CommentStatisticsUnitTest::fetchObjectCallback()
- 11.x core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php \Drupal\Tests\comment\Unit\CommentStatisticsUnitTest::fetchObjectCallback()
Return value callback for fetchObject() function on mocked object.
Return value
bool|string 'Something' on first, 'something-else' on second and FALSE for the other calls to function.
File
-
core/
modules/ comment/ tests/ src/ Unit/ CommentStatisticsUnitTest.php, line 115
Class
- CommentStatisticsUnitTest
- @coversDefaultClass \Drupal\comment\CommentStatistics @group comment
Namespace
Drupal\Tests\comment\UnitCode
public function fetchObjectCallback() {
$this->callsToFetch++;
switch ($this->callsToFetch) {
case 1:
return 'something';
case 2:
return 'something-else';
default:
return FALSE;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.