diff --git a/autoload.php b/autoload.php index 646d26b..e7798a4 100644 --- a/autoload.php +++ b/autoload.php @@ -1,9 +1,11 @@ true, + 'verboseOutput' => true +]); + +$test->describe('', function($test): void { + $test->it('', function($test): void { + // TODO + }); +}); \ No newline at end of file diff --git a/src/Site/Lib/Activitypub.php b/src/Std/Lib/Activitypub.php similarity index 99% rename from src/Site/Lib/Activitypub.php rename to src/Std/Lib/Activitypub.php index 55df4b4..3cd0eac 100644 --- a/src/Site/Lib/Activitypub.php +++ b/src/Std/Lib/Activitypub.php @@ -1,7 +1,7 @@ rgb; } @@ -173,7 +173,7 @@ next_chunk: $bytes = $this->IHDR->colorType === 2 ? 3 : 1; for ($i = 0; $i < $length; $i += $bytes) { if ($this->IHDR->colorType === 2) { - $colors = new \Site\Lib\RGB(ord($data[$i]), ord($data[$i+1]), ord($data[$i+2])); + $colors = new \Std\Lib\RGB(ord($data[$i]), ord($data[$i+1]), ord($data[$i+2])); $vals[] = $colors->rgb; } else { $vals[] = ord($data[$i]); diff --git a/src/Site/Lib/Image/Targa.php b/src/Std/Lib/Image/Targa.php similarity index 95% rename from src/Site/Lib/Image/Targa.php rename to src/Std/Lib/Image/Targa.php index 7f3b1eb..5ab06f7 100644 --- a/src/Site/Lib/Image/Targa.php +++ b/src/Std/Lib/Image/Targa.php @@ -1,7 +1,7 @@ describe('ログインとログアウト', function($test): void { // $user = "admin1234"; // $pass = "testTEST1234!#$%@[]:;"; diff --git a/src/Site/Test/LibCurl.php b/src/Std/Test/LibCurl.php similarity index 98% rename from src/Site/Test/LibCurl.php rename to src/Std/Test/LibCurl.php index 43037f5..91ff155 100644 --- a/src/Site/Test/LibCurl.php +++ b/src/Std/Test/LibCurl.php @@ -1,10 +1,10 @@ true, @@ -80,7 +80,7 @@ $test->describe('マークダウン', function($test): void { $body = $md->parse(); $test->assertNotNull($body); - $expect = "

ケロケロ

"; + $expect = "

ケロケロ

"; $actual = trim($body); $test->assertEquals($expect, $actual); @@ -95,7 +95,7 @@ $test->describe('マークダウン', function($test): void { $body = $md->parse(); $test->assertNotNull($body); - $expect = "

ケロケロ

"; + $expect = "

ケロケロ

"; $actual = trim($body); $test->assertEquals($expect, $actual); @@ -110,7 +110,7 @@ $test->describe('マークダウン', function($test): void { $body = $md->parse(); $test->assertNotNull($body); - $expect = "

ケロケロ

"; + $expect = "

ケロケロ

"; $actual = trim($body); $test->assertEquals($expect, $actual); @@ -125,7 +125,7 @@ $test->describe('マークダウン', function($test): void { $body = $md->parse(); $test->assertNotNull($body); - $expect = "

ケロケロ

"; + $expect = "

ケロケロ

"; $actual = trim($body); $test->assertEquals($expect, $actual); @@ -140,7 +140,7 @@ $test->describe('マークダウン', function($test): void { $body = $md->parse(); $test->assertNotNull($body); - $expect = "
ケロケロ
"; + $expect = "
ケロケロ
"; $actual = trim($body); $test->assertEquals($expect, $actual); @@ -155,7 +155,7 @@ $test->describe('マークダウン', function($test): void { $body = $md->parse(); $test->assertNotNull($body); - $expect = "
ケロケロ
"; + $expect = "
ケロケロ
"; $actual = trim($body); $test->assertEquals($expect, $actual); diff --git a/src/Site/Test/LibRoute.php b/src/Std/Test/LibRoute.php similarity index 81% rename from src/Site/Test/LibRoute.php rename to src/Std/Test/LibRoute.php index cb625ff..58dc24d 100644 --- a/src/Site/Test/LibRoute.php +++ b/src/Std/Test/LibRoute.php @@ -1,10 +1,10 @@ true, @@ -25,7 +25,7 @@ $test->describe('ルート', function($test): void { [ 'method' => 'GET', 'path' => 'about', - 'class' => 'Site\Test\Webpage@about', + 'class' => 'Std\Test\Webpage@about', 'params' => [], ] ]; diff --git a/tester.php b/tester.php index 8ec4d4a..c5b82cd 100644 --- a/tester.php +++ b/tester.php @@ -8,15 +8,17 @@ if (!CURL_ENABLED) define('ACTIVITYPUB_ENABLED', false); mb_internal_encoding('UTF-8'); header('Content-Type: text/plain; charset=UTF-8'); -$testDir = ROOT.'/src/Site/Test'; -$testFiles = glob($testDir.'/*.php'); +$testDirs = [ROOT.'/src/Site/Test', ROOT.'/src/Std/Test']; +$testFiles = []; +foreach ($testDirs as $d) $testFiles[] = glob($d.'/*.php'); +$testFiles = array_merge(...$testFiles); if (empty($testFiles)) { - echo "テストファイルは{$testDir}にありません\n"; + echo "テストファイルではありません\n"; exit(1); } -echo "{$testDir}にある".count($testFiles)."個テストファイルを実行中:\n"; +echo count($testFiles)."個テストファイルを実行中:\n"; echo "------------------------------------------------\n"; $totalFiles = 0; diff --git a/util.php b/util.php index 4009de9..32fbda7 100644 --- a/util.php +++ b/util.php @@ -384,8 +384,8 @@ function countmatch(string $str): bool { return $len == $sum; } -function getImageInfo(string $url): \Site\Lib\Image { - $img = new \Site\Lib\Image($url); +function getImageInfo(string $url): \Std\Lib\Image { + $img = new \Std\Lib\Image($url); return $img; }