File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -244,7 +244,7 @@ protected function writeTempFileForContext(
244244 /** @var \RenokiCo\PhpK8s\KubernetesCluster $this */
245245 $ tempFolder = static ::$ tempFolder ?: sys_get_temp_dir ();
246246
247- $ tempFilePath = $ tempFolder .DIRECTORY_SEPARATOR .Str::slug ("ctx- {$ context }- {$ userName }- {$ url }- {$ fileName }" ) ;
247+ $ tempFilePath = $ tempFolder .DIRECTORY_SEPARATOR .Str::slug ("ctx- {$ context }- {$ userName }- {$ url }" ). " - {$ fileName }" ;
248248
249249 if (file_exists ($ tempFilePath )) {
250250 return $ tempFilePath ;
Original file line number Diff line number Diff line change 1111
1212class KubeConfigTest extends TestCase
1313{
14+ private $ tempFolder ;
15+
1416 /**
1517 * {@inheritdoc}
1618 */
1719 public function setUp (): void
1820 {
1921 parent ::setUp ();
2022
21- KubernetesCluster::setTempFolder (__DIR__ .DIRECTORY_SEPARATOR .'temp ' );
23+ $ this ->tempFolder = __DIR__ .DIRECTORY_SEPARATOR .'temp ' ;
24+ KubernetesCluster::setTempFolder ($ this ->tempFolder );
2225 }
2326
2427 /**
@@ -41,6 +44,12 @@ public function test_kube_config_from_yaml_file_with_base64_encoded_ssl()
4144 'ssl_key ' => $ keyPath ,
4245 ] = $ cluster ->getClient ()->getConfig ();
4346
47+ $ tempFilePath = $ this ->tempFolder .DIRECTORY_SEPARATOR .'ctx-minikube-minikube-httpsminikube8443- ' ;
48+
49+ $ this ->assertSame ($ tempFilePath .'ca-cert.pem ' , $ caPath );
50+ $ this ->assertSame ($ tempFilePath .'client-cert.pem ' , $ certPath );
51+ $ this ->assertSame ($ tempFilePath .'client-key.pem ' , $ keyPath );
52+
4453 $ this ->assertEquals ("some-ca \n" , file_get_contents ($ caPath ));
4554 $ this ->assertEquals ("some-cert \n" , file_get_contents ($ certPath ));
4655 $ this ->assertEquals ("some-key \n" , file_get_contents ($ keyPath ));
You can’t perform that action at this time.
0 commit comments