summaryrefslogtreecommitdiff
path: root/tests/app/Http/Controllers/Admin/UpgradeControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/app/Http/Controllers/Admin/UpgradeControllerTest.php')
-rw-r--r--tests/app/Http/Controllers/Admin/UpgradeControllerTest.php54
1 files changed, 28 insertions, 26 deletions
diff --git a/tests/app/Http/Controllers/Admin/UpgradeControllerTest.php b/tests/app/Http/Controllers/Admin/UpgradeControllerTest.php
index 357c79ff05..9de2f910a0 100644
--- a/tests/app/Http/Controllers/Admin/UpgradeControllerTest.php
+++ b/tests/app/Http/Controllers/Admin/UpgradeControllerTest.php
@@ -19,6 +19,8 @@ declare(strict_types=1);
namespace Fisharebest\Webtrees\Http\Controllers\Admin;
use Exception;
+use Fig\Http\Message\RequestMethodInterface;
+use Fig\Http\Message\StatusCodeInterface;
use Fisharebest\Webtrees\Auth;
use Fisharebest\Webtrees\Services\TimeoutService;
use Fisharebest\Webtrees\Services\UpgradeService;
@@ -48,10 +50,10 @@ class UpgradeControllerTest extends TestCase
new UpgradeService(new TimeoutService())
);
- $request = self::createRequest(self::METHOD_GET, ['route' => 'wizard']);
+ $request = self::createRequest(RequestMethodInterface::METHOD_GET, ['route' => 'wizard']);
$response = $controller->wizard($request);
- $this->assertSame(self::STATUS_OK, $response->getStatusCode());
+ $this->assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
}
/**
@@ -66,10 +68,10 @@ class UpgradeControllerTest extends TestCase
new UpgradeService(new TimeoutService())
);
- $request = self::createRequest(self::METHOD_GET, ['route' => 'wizard', 'continue' => '1']);
+ $request = self::createRequest(RequestMethodInterface::METHOD_GET, ['route' => 'wizard', 'continue' => '1']);
$response = $controller->wizard($request);
- $this->assertSame(self::STATUS_OK, $response->getStatusCode());
+ $this->assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
}
/**
@@ -83,7 +85,7 @@ class UpgradeControllerTest extends TestCase
new UpgradeService(new TimeoutService())
);
- $request = self::createRequest(self::METHOD_POST, ['route' => 'wizard', 'step' => 'Invalid']);
+ $request = self::createRequest(RequestMethodInterface::METHOD_POST, ['route' => 'wizard', 'step' => 'Invalid']);
$controller->step($request);
}
@@ -99,10 +101,10 @@ class UpgradeControllerTest extends TestCase
$mock_upgrade_service
);
- $request = self::createRequest(self::METHOD_POST, ['route' => 'wizard', 'step' => 'Check']);
+ $request = self::createRequest(RequestMethodInterface::METHOD_POST, ['route' => 'wizard', 'step' => 'Check']);
$response = $controller->step($request);
- $this->assertSame(self::STATUS_OK, $response->getStatusCode());
+ $this->assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
}
/**
@@ -118,7 +120,7 @@ class UpgradeControllerTest extends TestCase
$mock_upgrade_service
);
- $request = self::createRequest(self::METHOD_POST, ['route' => 'wizard', 'step' => 'Check']);
+ $request = self::createRequest(RequestMethodInterface::METHOD_POST, ['route' => 'wizard', 'step' => 'Check']);
$controller->step($request);
}
@@ -135,7 +137,7 @@ class UpgradeControllerTest extends TestCase
$mock_upgrade_service
);
- $request = self::createRequest(self::METHOD_POST, ['route' => 'wizard', 'step' => 'Check']);
+ $request = self::createRequest(RequestMethodInterface::METHOD_POST, ['route' => 'wizard', 'step' => 'Check']);
$controller->step($request);
}
@@ -149,10 +151,10 @@ class UpgradeControllerTest extends TestCase
new UpgradeService(new TimeoutService())
);
- $request = self::createRequest(self::METHOD_POST, ['route' => 'wizard', 'step' => 'Prepare']);
+ $request = self::createRequest(RequestMethodInterface::METHOD_POST, ['route' => 'wizard', 'step' => 'Prepare']);
$response = $controller->step($request);
- $this->assertSame(self::STATUS_OK, $response->getStatusCode());
+ $this->assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
}
/**
@@ -165,10 +167,10 @@ class UpgradeControllerTest extends TestCase
new UpgradeService(new TimeoutService())
);
- $request = self::createRequest(self::METHOD_POST, ['route' => 'wizard', 'step' => 'Pending']);
+ $request = self::createRequest(RequestMethodInterface::METHOD_POST, ['route' => 'wizard', 'step' => 'Pending']);
$response = $controller->step($request);
- $this->assertSame(self::STATUS_OK, $response->getStatusCode());
+ $this->assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
}
/**
@@ -187,7 +189,7 @@ class UpgradeControllerTest extends TestCase
new UpgradeService(new TimeoutService())
);
- $request = self::createRequest(self::METHOD_POST, ['route' => 'wizard', 'step' => 'Pending']);
+ $request = self::createRequest(RequestMethodInterface::METHOD_POST, ['route' => 'wizard', 'step' => 'Pending']);
$controller->step($request);
}
@@ -202,16 +204,16 @@ class UpgradeControllerTest extends TestCase
new UpgradeService(new TimeoutService())
);
- $request = self::createRequest(self::METHOD_POST, ['route' => 'wizard', 'step' => 'Export'])
+ $request = self::createRequest(RequestMethodInterface::METHOD_POST, ['route' => 'wizard', 'step' => 'Export'])
->withAttribute('tree', $tree);
$response = $controller->step($request);
- $this->assertSame(self::STATUS_OK, $response->getStatusCode());
+ $this->assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
// Now overwrite the file we just created
$response = $controller->step($request);
- $this->assertSame(self::STATUS_OK, $response->getStatusCode());
+ $this->assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
}
/**
@@ -227,7 +229,7 @@ class UpgradeControllerTest extends TestCase
$mock_upgrade_service
);
- $request = self::createRequest(self::METHOD_POST, ['route' => 'wizard', 'step' => 'Download']);
+ $request = self::createRequest(RequestMethodInterface::METHOD_POST, ['route' => 'wizard', 'step' => 'Download']);
$controller->step($request);
}
@@ -243,10 +245,10 @@ class UpgradeControllerTest extends TestCase
$mock_upgrade_service
);
- $request = self::createRequest(self::METHOD_POST, ['route' => 'wizard', 'step' => 'Download']);
+ $request = self::createRequest(RequestMethodInterface::METHOD_POST, ['route' => 'wizard', 'step' => 'Download']);
$response = $controller->step($request);
- $this->assertSame(self::STATUS_OK, $response->getStatusCode());
+ $this->assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
}
/**
@@ -261,10 +263,10 @@ class UpgradeControllerTest extends TestCase
$mock_upgrade_service
);
- $request = self::createRequest(self::METHOD_POST, ['route' => 'wizard', 'step' => 'Unzip']);
+ $request = self::createRequest(RequestMethodInterface::METHOD_POST, ['route' => 'wizard', 'step' => 'Unzip']);
$response = $controller->step($request);
- $this->assertSame(self::STATUS_OK, $response->getStatusCode());
+ $this->assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
}
/**
@@ -277,10 +279,10 @@ class UpgradeControllerTest extends TestCase
new UpgradeService(new TimeoutService())
);
- $request = self::createRequest(self::METHOD_POST, ['route' => 'wizard', 'step' => 'Copy']);
+ $request = self::createRequest(RequestMethodInterface::METHOD_POST, ['route' => 'wizard', 'step' => 'Copy']);
$response = $controller->step($request);
- $this->assertSame(self::STATUS_OK, $response->getStatusCode());
+ $this->assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
}
/**
@@ -294,9 +296,9 @@ class UpgradeControllerTest extends TestCase
$mock_upgrade_service
);
- $request = self::createRequest(self::METHOD_POST, ['route' => 'wizard', 'step' => 'Cleanup']);
+ $request = self::createRequest(RequestMethodInterface::METHOD_POST, ['route' => 'wizard', 'step' => 'Cleanup']);
$response = $controller->step($request);
- $this->assertSame(self::STATUS_OK, $response->getStatusCode());
+ $this->assertSame(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
}
}