Files
lang/tests/Development/PhpTest.php
T
2021-12-01 18:54:23 +03:00

35 lines
900 B
PHP

<?php
namespace Tests\Development;
use DragonCode\PrettyArray\Services\File as Pretty;
class PhpTest extends TestCase
{
public function testPhp(): void
{
foreach ($this->files('.php') as $filename) {
$source = $this->source($filename);
foreach ($this->locales() as $locale) {
$path = $this->target_path . '/' . $locale . '/' . $filename;
$target = $this->load($path);
$this->assertSame(array_keys($source), array_keys($target), $this->messageForLocale($path, $locale));
if ($this->isInline($filename)) {
$this->assertDoesntSee($path, [':attribute', ':Attribute']);
}
}
}
}
protected function load(string $path): array
{
$items = Pretty::make()->load($path);
return $this->correctValues($items);
}
}