generated from renoki-co/laravel-package-skeleton
-
-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathExpressionTest.php
74 lines (60 loc) · 1.86 KB
/
ExpressionTest.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
namespace RenokiCo\PhpK8s\Test;
use RenokiCo\PhpK8s\K8s;
class ExpressionTest extends TestCase
{
public function test_expression_in()
{
$expression = K8s::expression()->in('some-key', ['val1', 'val2']);
$this->assertEquals([
'key' => 'some-key',
'operator' => 'In',
'values' => ['val1', 'val2'],
], $expression->toArray());
}
public function test_expression_not_in()
{
$expression = K8s::expression()->notIn('some-key', ['val1', 'val2']);
$this->assertEquals([
'key' => 'some-key',
'operator' => 'NotIn',
'values' => ['val1', 'val2'],
], $expression->toArray());
}
public function test_expression_exists()
{
$expression = K8s::expression()->exists('some-key');
$this->assertEquals([
'key' => 'some-key',
'operator' => 'Exists',
'values' => [],
], $expression->toArray());
}
public function test_expression_does_not_exist()
{
$expression = K8s::expression()->doesNotExist('some-key');
$this->assertEquals([
'key' => 'some-key',
'operator' => 'DoesNotExists',
'values' => [],
], $expression->toArray());
}
public function test_expression_greater_than()
{
$expression = K8s::expression()->greaterThan('some-key', '1');
$this->assertEquals([
'key' => 'some-key',
'operator' => 'Gt',
'values' => ['1'],
], $expression->toArray());
}
public function test_expression_less_than()
{
$expression = K8s::expression()->lessThan('some-key', '1');
$this->assertEquals([
'key' => 'some-key',
'operator' => 'Lt',
'values' => ['1'],
], $expression->toArray());
}
}