summaryrefslogtreecommitdiffstats
path: root/php-williamdes-mariadb-mysql-kbs-layout.patch
diff options
context:
space:
mode:
Diffstat (limited to 'php-williamdes-mariadb-mysql-kbs-layout.patch')
-rw-r--r--php-williamdes-mariadb-mysql-kbs-layout.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/php-williamdes-mariadb-mysql-kbs-layout.patch b/php-williamdes-mariadb-mysql-kbs-layout.patch
new file mode 100644
index 0000000..9858a8e
--- /dev/null
+++ b/php-williamdes-mariadb-mysql-kbs-layout.patch
@@ -0,0 +1,41 @@
+diff -up ./src/merge.php.rpm ./src/merge.php
+diff -up ./src/Search.php.rpm ./src/Search.php
+--- ./src/Search.php.rpm 2019-09-12 10:53:45.797567100 +0200
++++ ./src/Search.php 2019-09-12 11:01:04.702560202 +0200
+@@ -25,7 +25,7 @@ class Search
+ public const MYSQL = 1;
+ public const MARIADB = 2;
+ public const DS = DIRECTORY_SEPARATOR;
+- public static $DATA_DIR = __DIR__.self::DS."..".self::DS."dist".self::DS;
++ public static $DATA_DIR = '/usr/share/php-williamdes-mariadb-mysql-kbs/dist/';
+
+ /**
+ * Load data from disk
+diff -up ./test/SearchTest.php.rpm ./test/SearchTest.php
+--- ./test/SearchTest.php.rpm 2019-09-12 14:45:12.103423385 +0200
++++ ./test/SearchTest.php 2019-09-12 14:45:15.407409867 +0200
+@@ -175,4 +175,24 @@ class SearchTest extends TestCase
+ $this->assertEquals("boolean", $type);
+ }
+
++
++ /**
++ * test RPM Layout
++ *
++ * @runInSeparateProcess
++ *
++ * @return void
++ */
++ public function testLayout(): void
++ {
++ if (!getenv("RPM_BUILDROOT")) {
++ $this->markTestSkipped("No RPM_BUILDROOT");
++ }
++ Search::$loaded = false;
++ Search::$DATA_DIR = getenv("RPM_BUILDROOT") . Search::$DATA_DIR;
++ $found = Search::getByName("max_connections", Search::MYSQL);
++ $this->assertContains('php-williamdes-mariadb-mysql-kb', Search::$DATA_DIR);
++ $this->assertContains(getenv("RPM_BUILDROOT"), Search::$DATA_DIR);
++ $this->assertTrue(Search::$loaded);
++ }
+ }