Skip to content
Snippets Groups Projects
Commit 08c0572f authored by Ludovic Ganée's avatar Ludovic Ganée
Browse files

qualité du code

parent 74b81067
No related branches found
No related tags found
No related merge requests found
Pipeline #59638 failed
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
"ext-mbstring": "*", "ext-mbstring": "*",
"ext-openssl": "*", "ext-openssl": "*",
"ext-pdo": "*", "ext-pdo": "*",
"ext-posix": "*",
"ext-soap": "*", "ext-soap": "*",
"ext-sockets": "*", "ext-sockets": "*",
"ext-xml": "*", "ext-xml": "*",
......
This diff is collapsed.
...@@ -161,7 +161,7 @@ class MinkCase implements MinkCaseInterface, SetupMinkInterface ...@@ -161,7 +161,7 @@ class MinkCase implements MinkCaseInterface, SetupMinkInterface
/** /**
* Fait un screenshot * Fait un screenshot
* @param string $path * @param string|null $path
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
...@@ -169,7 +169,7 @@ class MinkCase implements MinkCaseInterface, SetupMinkInterface ...@@ -169,7 +169,7 @@ class MinkCase implements MinkCaseInterface, SetupMinkInterface
{ {
$path = $path ?: self::getScreenshotPath(); $path = $path ?: self::getScreenshotPath();
if (!is_dir(dirname($path))) { if (!is_dir(dirname($path))) {
mkdir(dirname($path), 0777); mkdir(dirname($path), 0777, true);
} }
$this->driver->captureScreenshot($path); $this->driver->captureScreenshot($path);
if (!env('LINES')) { if (!env('LINES')) {
...@@ -180,7 +180,8 @@ class MinkCase implements MinkCaseInterface, SetupMinkInterface ...@@ -180,7 +180,8 @@ class MinkCase implements MinkCaseInterface, SetupMinkInterface
/** /**
* Fait un screenshot et l'envoi sur un serveur * Fait un screenshot et l'envoi sur un serveur
* @param string $path * @param string|null $path
* @param string $url
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
...@@ -191,7 +192,7 @@ class MinkCase implements MinkCaseInterface, SetupMinkInterface ...@@ -191,7 +192,7 @@ class MinkCase implements MinkCaseInterface, SetupMinkInterface
$path = $path ?: self::getScreenshotPath(); $path = $path ?: self::getScreenshotPath();
$this->screenshot($path); $this->screenshot($path);
$response = $this->upload($path); $response = $this->upload($path, $url);
$status = $response->getStatusCode(); $status = $response->getStatusCode();
$response = $response->getStringBody(); $response = $response->getStringBody();
if ($status === 200) { if ($status === 200) {
...@@ -203,7 +204,7 @@ class MinkCase implements MinkCaseInterface, SetupMinkInterface ...@@ -203,7 +204,7 @@ class MinkCase implements MinkCaseInterface, SetupMinkInterface
/** /**
* Sauvegarde le html dans un fichier * Sauvegarde le html dans un fichier
* @param string $path * @param string|null $path
* @return void * @return void
*/ */
public function exportHtml(string $path = null): void public function exportHtml(string $path = null): void
...@@ -219,7 +220,8 @@ class MinkCase implements MinkCaseInterface, SetupMinkInterface ...@@ -219,7 +220,8 @@ class MinkCase implements MinkCaseInterface, SetupMinkInterface
/** /**
* Upload le html * Upload le html
* @param string $path * @param string|null $path
* @param string $url
* @return void * @return void
*/ */
public function htmlUpload( public function htmlUpload(
...@@ -229,7 +231,7 @@ class MinkCase implements MinkCaseInterface, SetupMinkInterface ...@@ -229,7 +231,7 @@ class MinkCase implements MinkCaseInterface, SetupMinkInterface
$path = $path ?: (basename(self::getScreenshotPath(), '.png') . '.html'); $path = $path ?: (basename(self::getScreenshotPath(), '.png') . '.html');
$this->exportHtml($path); $this->exportHtml($path);
$response = $this->upload($path); $response = $this->upload($path, $url);
$status = $response->getStatusCode(); $status = $response->getStatusCode();
$response = $response->getStringBody(); $response = $response->getStringBody();
if ($status === 200) { if ($status === 200) {
...@@ -805,6 +807,7 @@ js ...@@ -805,6 +807,7 @@ js
break; break;
} }
} }
/** @noinspection PhpUndefinedMethodInspection */
$classLoader = $autoloaderClassName::getLoader(); $classLoader = $autoloaderClassName::getLoader();
self::$classes = $classLoader->getClassMap(); self::$classes = $classLoader->getClassMap();
} }
......
...@@ -139,7 +139,7 @@ class Exec ...@@ -139,7 +139,7 @@ class Exec
*/ */
public static function procIsRunning(int $pid): bool public static function procIsRunning(int $pid): bool
{ {
if (posix_kill($pid,0) !== false) { if (posix_kill($pid, 0) !== false) {
if (!in_array($pid, self::getZombieList())) { if (!in_array($pid, self::getZombieList())) {
posix_kill($pid, 9); posix_kill($pid, 9);
return false; return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment