Skip to content

Commit a9ee656

Browse files
committed
ICM: Timeout tests added.
1 parent 2717423 commit a9ee656

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

tests/WithoutOverlappingTraitTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ public function it_adds_mutex_timeout_which_is_zero_by_default()
2929
$this->assertEquals(0, (new GenericCommand)->getMutexTimeout());
3030
}
3131

32+
/** @test */
33+
public function mutex_timeout_can_be_overloaded_by_protected_field()
34+
{
35+
$this->assertEquals(3000, (new TimeoutCommand)->getMutexTimeout());
36+
}
37+
3238
/** @test */
3339
public function it_generates_mutex_name_based_on_the_command_name_and_arguments()
3440
{
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
use Illuminate\Console\Command;
4+
use Illuminated\Console\WithoutOverlapping;
5+
6+
class TimeoutCommand extends Command
7+
{
8+
use WithoutOverlapping;
9+
10+
protected $signature = 'icm:timeout-command';
11+
protected $mutexTimeout = 3000;
12+
13+
public function handle()
14+
{
15+
$this->info('Done!');
16+
}
17+
}

tests/fixture/app/Console/Kernel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ class Kernel extends \Orchestra\Testbench\Console\Kernel
55
protected $commands = [
66
GenericCommand::class,
77
MysqlStrategyCommand::class,
8+
TimeoutCommand::class,
89
];
910
}

0 commit comments

Comments
 (0)