Home
DevCentral
Search
Configure Global Search
Log In
Transactions
T1387
Change Details
Change Details
Old
New
Diff
Nasqueron\Notifications\Tests\Jobs\NotifyNewCommitsToDiffusionTest::testHandle with data set #2 (null, 1) ErrorException: count(): Parameter must be an array or an object that implements Countable /usr/home/dereckson/dev/nasqueron/notifications/repo/app/Jobs/NotifyNewCommitsToDiffusion.php:182 /usr/home/dereckson/dev/nasqueron/notifications/repo/app/Jobs/NotifyNewCommitsToDiffusion.php:162 /usr/home/dereckson/dev/nasqueron/notifications/repo/app/Jobs/NotifyNewCommitsToDiffusion.php:137 /usr/home/dereckson/dev/nasqueron/notifications/repo/app/Jobs/NotifyNewCommitsToDiffusion.php:76 /usr/home/dereckson/dev/nasqueron/notifications/repo/tests/Jobs/NotifyNewCommitsToDiffusionTest.php:32 ```name=Test,language=php /** * Provides API repository reply and associated API calls count */ public function apiRepositoryReplyProvider () : array { return [ // Regular behavior [[new class { public $callsign = "K2"; }], 2], // Phabricator doesn't know this repo [[], 1], // Some error occurs and the API reply is null [null, 1], ]; } /** * @dataProvider apiRepositoryReplyProvider */ public function testHandle ($apiRepositoryReply, int $apiCallCounts) { $this->mockPhabricatorAPI() ->shouldReceive('getForProject->call') ->andReturn( // First API call: repository.query $apiRepositoryReply, // Second API call: diffusion.looksoon null ) ->times($apiCallCounts); // 2 when repository.query is valid // 1 otherwise $job = $this->mockJob(); $job->handle(); } ```
Nasqueron\Notifications\Tests\Jobs\NotifyNewCommitsToDiffusionTest::testHandle with data set #2 (null, 1) ErrorException: count(): Parameter must be an array or an object that implements Countable /usr/home/dereckson/dev/nasqueron/notifications/repo/app/Jobs/NotifyNewCommitsToDiffusion.php:182 /usr/home/dereckson/dev/nasqueron/notifications/repo/app/Jobs/NotifyNewCommitsToDiffusion.php:162 /usr/home/dereckson/dev/nasqueron/notifications/repo/app/Jobs/NotifyNewCommitsToDiffusion.php:137 /usr/home/dereckson/dev/nasqueron/notifications/repo/app/Jobs/NotifyNewCommitsToDiffusion.php:76 /usr/home/dereckson/dev/nasqueron/notifications/repo/tests/Jobs/NotifyNewCommitsToDiffusionTest.php:32 ```name=Test,lang=php /** * Provides API repository reply and associated API calls count */ public function apiRepositoryReplyProvider () : array { return [ // Regular behavior [[new class { public $callsign = "K2"; }], 2], // Phabricator doesn't know this repo [[], 1], // Some error occurs and the API reply is null [null, 1], ]; } /** * @dataProvider apiRepositoryReplyProvider */ public function testHandle ($apiRepositoryReply, int $apiCallCounts) { $this->mockPhabricatorAPI() ->shouldReceive('getForProject->call') ->andReturn( // First API call: repository.query $apiRepositoryReply, // Second API call: diffusion.looksoon null ) ->times($apiCallCounts); // 2 when repository.query is valid // 1 otherwise $job = $this->mockJob(); $job->handle(); } ```
Nasqueron\Notifications\Tests\Jobs\NotifyNewCommitsToDiffusionTest::testHandle with data set #2 (null, 1) ErrorException: count(): Parameter must be an array or an object that implements Countable /usr/home/dereckson/dev/nasqueron/notifications/repo/app/Jobs/NotifyNewCommitsToDiffusion.php:182 /usr/home/dereckson/dev/nasqueron/notifications/repo/app/Jobs/NotifyNewCommitsToDiffusion.php:162 /usr/home/dereckson/dev/nasqueron/notifications/repo/app/Jobs/NotifyNewCommitsToDiffusion.php:137 /usr/home/dereckson/dev/nasqueron/notifications/repo/app/Jobs/NotifyNewCommitsToDiffusion.php:76 /usr/home/dereckson/dev/nasqueron/notifications/repo/tests/Jobs/NotifyNewCommitsToDiffusionTest.php:32 ```name=Test,lang
uage
=php /** * Provides API repository reply and associated API calls count */ public function apiRepositoryReplyProvider () : array { return [ // Regular behavior [[new class { public $callsign = "K2"; }], 2], // Phabricator doesn't know this repo [[], 1], // Some error occurs and the API reply is null [null, 1], ]; } /** * @dataProvider apiRepositoryReplyProvider */ public function testHandle ($apiRepositoryReply, int $apiCallCounts) { $this->mockPhabricatorAPI() ->shouldReceive('getForProject->call') ->andReturn( // First API call: repository.query $apiRepositoryReply, // Second API call: diffusion.looksoon null ) ->times($apiCallCounts); // 2 when repository.query is valid // 1 otherwise $job = $this->mockJob(); $job->handle(); } ```
Continue