-
-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathRoboFile.php
74 lines (62 loc) · 1.66 KB
/
RoboFile.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
use Robo\Collection\CollectionBuilder;
use Robo\Result;
use Robo\Tasks;
use Robo\Collection\Collection;
require_once 'vendor/autoload.php';
class RoboFile extends Tasks
{
public function build(): Result
{
return (new Collection())
->add($this->taskFixCodeStyle())
->add($this->taskPhpUnit())
->run();
}
public function test(): Result
{
return $this->taskPhpUnit()->run();
}
public function testAll(): Result
{
return (new Collection())
->add($this->taskTestPredis())
->add($this->taskTestPhpRedis())
->add($this->taskTestRedisClient())
->run();
}
public function testPredis(): Result
{
return $this->taskTestPredis()->run();
}
public function testPhpRedis(): Result
{
return $this->taskTestPhpRedis()->run();
}
public function testRedisClient(): Result
{
return $this->taskTestRedisClient()->run();
}
public function taskFixCodeStyle(): CollectionBuilder
{
return $this->taskExec('./vendor/bin/php-cs-fixer fix src');
}
public function taskTestPredis(): CollectionBuilder
{
$task = $this->taskPhpUnit();
$task->env('REDIS_LIBRARY', 'Predis');
return $task;
}
public function taskTestPhpRedis(): CollectionBuilder
{
$task = $this->taskPhpUnit();
$task->env('REDIS_LIBRARY', 'PhpRedis');
return $task;
}
public function taskTestRedisClient(): CollectionBuilder
{
$task = $this->taskPhpUnit();
$task->env('REDIS_LIBRARY', 'RedisClient');
return $task;
}
}