Merge pull request #19552 from kamil-tekiela/Fix-default-values
[phpmyadmin.git] / tests / unit / Engines / BdbTest.php
blobd20c49728296e93852647d12f41c1b32b74cb4b7
1 <?php
3 declare(strict_types=1);
5 namespace PhpMyAdmin\Tests\Engines;
7 use PhpMyAdmin\Dbal\DatabaseInterface;
8 use PhpMyAdmin\Engines\Bdb;
9 use PhpMyAdmin\Tests\AbstractTestCase;
10 use PHPUnit\Framework\Attributes\CoversClass;
12 use function __;
14 #[CoversClass(Bdb::class)]
15 class BdbTest extends AbstractTestCase
17 protected Bdb $object;
19 /**
20 * Sets up the fixture, for example, opens a network connection.
21 * This method is called before a test is executed.
23 protected function setUp(): void
25 parent::setUp();
27 DatabaseInterface::$instance = $this->createDatabaseInterface();
28 $this->object = new Bdb('bdb');
31 /**
32 * Tears down the fixture, for example, closes a network connection.
33 * This method is called after a test is executed.
35 protected function tearDown(): void
37 parent::tearDown();
39 unset($this->object);
42 /**
43 * Test for getVariables
45 public function testGetVariables(): void
47 self::assertSame(
48 $this->object->getVariables(),
50 'version_bdb' => ['title' => __('Version information')],
51 'bdb_cache_size' => ['type' => 1],
52 'bdb_home' => [],
53 'bdb_log_buffer_size' => ['type' => 1],
54 'bdb_logdir' => [],
55 'bdb_max_lock' => ['type' => 2],
56 'bdb_shared_data' => [],
57 'bdb_tmpdir' => [],
58 'bdb_data_direct' => [],
59 'bdb_lock_detect' => [],
60 'bdb_log_direct' => [],
61 'bdb_no_recover' => [],
62 'bdb_no_sync' => [],
63 'skip_sync_bdb_logs' => [],
64 'sync_bdb_logs' => [],
69 /**
70 * Test for getVariablesLikePattern
72 public function testGetVariablesLikePattern(): void
74 self::assertSame(
75 $this->object->getVariablesLikePattern(),
76 '%bdb%',
80 /**
81 * Test for getMysqlHelpPage
83 public function testGetMysqlHelpPage(): void
85 self::assertSame(
86 $this->object->getMysqlHelpPage(),
87 'bdb',