unify test class naming

This commit is contained in:
Andrew Dolgov 2023-10-27 22:10:28 +03:00
parent 5a7c5b8249
commit 925256c81f
No known key found for this signature in database
GPG Key ID: 1A56B4FA25D4AF2A
2 changed files with 15 additions and 20 deletions

View File

@ -2,7 +2,7 @@
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
final class SelfUrlPathTest extends TestCase { final class SelfUrlPathTest extends TestCase {
public function test_a(): void { public function test_self_url_a(): void {
$_SERVER = []; $_SERVER = [];
$_SERVER["HTTP_X_FORWARDED_PROTO"] = "http"; $_SERVER["HTTP_X_FORWARDED_PROTO"] = "http";
@ -16,7 +16,7 @@ final class SelfUrlPathTest extends TestCase {
} }
public function test_b(): void { public function test_self_url_b(): void {
$_SERVER = []; $_SERVER = [];
$_SERVER["HTTP_X_FORWARDED_PROTO"] = "https"; $_SERVER["HTTP_X_FORWARDED_PROTO"] = "https";
@ -29,7 +29,7 @@ final class SelfUrlPathTest extends TestCase {
); );
} }
public function test_c(): void { public function test_self_url_c(): void {
$_SERVER = []; $_SERVER = [];
$_SERVER["HTTP_X_FORWARDED_PROTO"] = "https"; $_SERVER["HTTP_X_FORWARDED_PROTO"] = "https";
@ -42,7 +42,7 @@ final class SelfUrlPathTest extends TestCase {
); );
} }
public function test_d(): void { public function test_self_url_d(): void {
$_SERVER = []; $_SERVER = [];
$_SERVER["HTTP_X_FORWARDED_PROTO"] = "https"; $_SERVER["HTTP_X_FORWARDED_PROTO"] = "https";
@ -55,7 +55,7 @@ final class SelfUrlPathTest extends TestCase {
); );
} }
public function test_e(): void { public function test_self_url_e(): void {
$_SERVER = []; $_SERVER = [];
$_SERVER["HTTP_X_FORWARDED_PROTO"] = "https"; $_SERVER["HTTP_X_FORWARDED_PROTO"] = "https";
@ -68,7 +68,7 @@ final class SelfUrlPathTest extends TestCase {
); );
} }
public function test_f(): void { public function test_self_url_f(): void {
$_SERVER = []; $_SERVER = [];
$_SERVER["HTTP_HOST"] = "example.com"; $_SERVER["HTTP_HOST"] = "example.com";
@ -80,7 +80,7 @@ final class SelfUrlPathTest extends TestCase {
); );
} }
public function test_g(): void { public function test_self_url_g(): void {
$_SERVER = []; $_SERVER = [];
$_SERVER["HTTP_HOST"] = "example.com"; $_SERVER["HTTP_HOST"] = "example.com";
@ -92,7 +92,7 @@ final class SelfUrlPathTest extends TestCase {
); );
} }
public function test_h(): void { public function test_self_url_h(): void {
$_SERVER = []; $_SERVER = [];
$_SERVER["HTTP_HOST"] = "example.com"; $_SERVER["HTTP_HOST"] = "example.com";
@ -103,4 +103,11 @@ final class SelfUrlPathTest extends TestCase {
Config::get_self_url(true) Config::get_self_url(true)
); );
} }
public function test_get_self_dir(): void {
$this->assertEquals(
dirname(__DIR__), # we're in (app)/tests/
Config::get_self_dir()
);
}
} }

View File

@ -1,12 +0,0 @@
<?php
use PHPUnit\Framework\TestCase;
final class ConfigTest extends TestCase {
public function test_get_self_dir(): void {
$this->assertEquals(
dirname(__DIR__), # we're in (app)/tests/
Config::get_self_dir()
);
}
}