Files
postgresql-for-wordpress/tests/verifyAgainstStubsTest.php
2023-10-30 14:24:27 -07:00

27 lines
710 B
PHP

<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;
if (!defined('ABSPATH')) {
define('ABSPATH', __DIR__ . "/../");
}
if (!defined('WPINC')) {
define('WPINC', 'wp-includes');
}
require_once __DIR__ . "/../pg4wp/db.php";
final class verifyAgainstStubsTest extends TestCase
{
const STUBS_DIRECTORY = __DIR__ . '/stubs';
public function test_verify_against_stubs()
{
$files = array_diff(scandir(self::STUBS_DIRECTORY), array('.', '..'));
foreach($files as $file) {
$data = json_decode(file_get_contents(self::STUBS_DIRECTORY . "/" . $file), true);
$this->assertSame(pg4wp_rewrite($data['mysql']), $data['postgresql']);
}
}
}