test: add test for getVersion()

This commit is contained in:
kenjis 2023-05-21 11:19:56 +09:00
parent d334a2a287
commit 00993a32cb
No known key found for this signature in database
GPG Key ID: BD254878922AF198

View File

@ -0,0 +1,34 @@
<?php
/**
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace CodeIgniter\Database\Live;
use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\Test\DatabaseTestTrait;
/**
* @group DatabaseLive
*
* @internal
*/
final class GetVersionTest extends CIUnitTestCase
{
use DatabaseTestTrait;
protected $migrate = false;
public function testGetVersion()
{
$version = $this->db->getVersion();
$this->assertMatchesRegularExpression('/\A\d+(\.\d+)*\z/', $version);
}
}