generated from renoki-co/laravel-package-skeleton
-
-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathTestCase.php
65 lines (55 loc) · 1.3 KB
/
TestCase.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
<?php
namespace RenokiCo\PhpK8s\Test;
use Orchestra\Testbench\TestCase as Orchestra;
use RenokiCo\PhpK8s\Exceptions\PhpK8sException;
use RenokiCo\PhpK8s\K8s;
use RenokiCo\PhpK8s\KubernetesCluster;
abstract class TestCase extends Orchestra
{
/**
* The cluster to the Kubernetes cluster.
*
* @var \RenokiCo\PhpK8s\KubernetesCluster
*/
protected $cluster;
/**
* Set up the tests.
*
* @return void
*/
public function setUp(): void
{
parent::setUp();
$this->cluster = new KubernetesCluster('http://127.0.0.1:8080');
$this->cluster->withoutSslChecks();
set_exception_handler(function ($exception) {
if ($exception instanceof PhpK8sException) {
dump($exception->getPayload());
dump($exception->getMessage());
}
});
K8s::flushMacros();
}
/**
* Get the package providers.
*
* @param mixed $app
* @return array
*/
protected function getPackageProviders($app)
{
return [
\RenokiCo\PhpK8s\PhpK8sServiceProvider::class,
];
}
/**
* Set up the environment.
*
* @param mixed $app
* @return void
*/
public function getEnvironmentSetUp($app)
{
//
}
}