function CommentStatisticsUnitTest::fetchObjectCallback
Same name in other branches
- 8.9.x core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php \Drupal\Tests\comment\Unit\CommentStatisticsUnitTest::fetchObjectCallback()
- 10 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 110
Class
- CommentStatisticsUnitTest
- @coversDefaultClass \Drupal\comment\CommentStatistics @group comment
Namespace
Drupal\Tests\comment\UnitCode
public function fetchObjectCallback() {
$this->calls_to_fetch++;
switch ($this->calls_to_fetch) {
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.