diff --git a/DataStorage/Database/Schema/Grammar/SQLiteGrammar.php b/DataStorage/Database/Schema/Grammar/SQLiteGrammar.php
index 5411b321b..b2237c005 100755
--- a/DataStorage/Database/Schema/Grammar/SQLiteGrammar.php
+++ b/DataStorage/Database/Schema/Grammar/SQLiteGrammar.php
@@ -129,14 +129,14 @@ class SQLiteGrammar extends Grammar
$fieldQuery .= ' ' . ($field['null'] ? '' : 'NOT ') . 'NULL';
}
- if ($field['primary'] ?? false) {
- $keys .= ' PRIMARY KEY';
- }
-
if ($field['autoincrement'] ?? false) {
$fieldQuery .= ' AUTOINCREMENT';
}
+ if ($field['primary'] ?? false) {
+ $fieldQuery .= ' PRIMARY KEY';
+ }
+
$fieldQuery .= ',';
if ($field['unique'] ?? false) {
diff --git a/Math/Matrix/Matrix.php b/Math/Matrix/Matrix.php
index a19d82d6f..debe8b447 100755
--- a/Math/Matrix/Matrix.php
+++ b/Math/Matrix/Matrix.php
@@ -853,20 +853,17 @@ class Matrix implements \ArrayAccess, \Iterator
throw new InvalidDimensionException($this->m . 'x' . $this->n);
}
- $sum = new IdentityMatrix($this->m);
+ $eig = new EigenvalueDecomposition($this);
+ $v = $eig->getV();
+ $d = $eig->getD();
- $factorial = 1;
- $pow = clone $sum;
+ $vInv = $v->inverse();
- for ($i = 1; $i <= $iterations; ++$i) {
- $factorial *= $i;
- $coeff = 1 / $factorial;
-
- $pow = $pow->mult($this);
- $sum = $sum->add($pow->mult($coeff));
+ for ($i = 0; $d->m; ++$i) {
+ $d->matrix[$i][$i] = \exp($d->matrix[$i][$i]);
}
- return $sum;
+ return $v->mult($d)->mult($vInv);
}
/**
diff --git a/Router/SocketRouter.php b/Router/SocketRouter.php
index a5cd0e9e5..079257df1 100755
--- a/Router/SocketRouter.php
+++ b/Router/SocketRouter.php
@@ -120,7 +120,7 @@ final class SocketRouter implements RouterInterface
{
$bound = [];
foreach ($this->routes as $route => $destination) {
- if (!((bool) \preg_match('~^' . $route . '$~', $uri))) {
+ if (!((bool) \preg_match('~' . $route . '~', $uri))) {
continue;
}
diff --git a/Router/WebRouter.php b/Router/WebRouter.php
index fd70cbd83..0e3796516 100755
--- a/Router/WebRouter.php
+++ b/Router/WebRouter.php
@@ -129,7 +129,7 @@ final class WebRouter implements RouterInterface
{
$bound = [];
foreach ($this->routes as $route => $destination) {
- if (!((bool) \preg_match('~^' . $route . '$~', $uri))) {
+ if (!((bool) \preg_match('~' . $route . '~', $uri))) {
continue;
}
diff --git a/Socket/Client/ClientConnection.php b/Socket/Client/ClientConnection.php
index 1f83b7da5..f10d4bf5a 100755
--- a/Socket/Client/ClientConnection.php
+++ b/Socket/Client/ClientConnection.php
@@ -36,7 +36,7 @@ class ClientConnection
private $connected = true;
- private Account $account;
+ public Account $account;
/**
* Constructor.
diff --git a/Socket/Server/Server.php b/Socket/Server/Server.php
index e1225eaa1..af1cc78a5 100755
--- a/Socket/Server/Server.php
+++ b/Socket/Server/Server.php
@@ -108,9 +108,9 @@ class Server extends SocketAbstract
*/
public function create(string $ip, int $port) : void
{
- $this->app->logger->info('Creating socket...');
+ $this->app->logger?->info('Creating socket...');
parent::create($ip, $port);
- $this->app->logger->info('Binding socket...');
+ $this->app->logger?->info('Binding socket...');
\socket_bind($this->sock, $this->ip, $this->port);
}
@@ -190,12 +190,12 @@ class Server extends SocketAbstract
*/
public function run() : void
{
- $this->app->logger->info('Start listening...');
+ $this->app->logger?->info('Start listening...');
@\socket_listen($this->sock);
@\socket_set_nonblock($this->sock);
$this->conn[] = $this->sock;
- $this->app->logger->info('Is running...');
+ $this->app->logger?->info('Is running...');
while ($this->run) {
$read = $this->conn;
@@ -225,12 +225,12 @@ class Server extends SocketAbstract
$data = \is_string($data) ? \trim($data) : '';
if (!$client->getHandshake()) {
- $this->app->logger->debug('Doing handshake...');
+ $this->app->logger?->debug('Doing handshake...');
if ($this->handshake($client, $data)) {
$client->setHandshake(true);
- $this->app->logger->debug('Handshake succeeded.');
+ $this->app->logger?->debug('Handshake succeeded.');
} else {
- $this->app->logger->debug('Handshake failed.');
+ $this->app->logger?->debug('Handshake failed.');
$this->disconnectClient($client);
}
} else {
@@ -239,7 +239,7 @@ class Server extends SocketAbstract
}
}
}
- $this->app->logger->info('Is shutdown...');
+ $this->app->logger?->info('Is shutdown...');
$this->close();
}
@@ -272,13 +272,13 @@ class Server extends SocketAbstract
*/
public function connectClient($socket) : void
{
- $this->app->logger->debug('Connecting client...');
+ $this->app->logger?->debug('Connecting client...');
$this->app->accountManager->add(new NullAccount(1));
$this->clientManager->add($client = new ClientConnection(new NullAccount(1), $socket));
$this->conn[$client->getId()] = $socket;
- $this->app->logger->debug('Connected client.');
+ $this->app->logger?->debug('Connected client.');
}
/**
@@ -292,7 +292,7 @@ class Server extends SocketAbstract
*/
public function disconnectClient($client) : void
{
- $this->app->logger->debug('Disconnecting client...');
+ $this->app->logger?->debug('Disconnecting client...');
$client->setConnected(false);
$client->setHandshake(false);
\socket_shutdown($client->getSocket(), 2);
@@ -303,7 +303,7 @@ class Server extends SocketAbstract
}
$this->clientManager->remove($client->id);
- $this->app->logger->debug('Disconnected client.');
+ $this->app->logger?->debug('Disconnected client.');
}
/**
diff --git a/System/File/Ftp/File.php b/System/File/Ftp/File.php
index 85d08ea4a..f583f0c9a 100755
--- a/System/File/Ftp/File.php
+++ b/System/File/Ftp/File.php
@@ -517,7 +517,7 @@ class File extends FileAbstract implements FileInterface
return false;
}
- $newParent = $this->findNode($to);
+ $newParent = $this->findNode(\dirname($to));
$state = self::copy($this->con, $this->path, $to, $overwrite);
diff --git a/System/File/Ftp/FileAbstract.php b/System/File/Ftp/FileAbstract.php
index f8d229d50..7a3b63606 100755
--- a/System/File/Ftp/FileAbstract.php
+++ b/System/File/Ftp/FileAbstract.php
@@ -238,11 +238,11 @@ abstract class FileAbstract implements FtpContainerInterface
*
* @param string $path Path of the node
*
- * @return null|Directory
+ * @return null|Directory|File
*
* @since 1.0.0
*/
- public function findNode(string $path) : ?Directory
+ public function findNode(string $path) : null|Directory|File
{
// Change parent element
$currentPath = \explode('/', \trim($this->path, '/'));
diff --git a/System/File/Local/File.php b/System/File/Local/File.php
index 9caaabbdd..b3c1e5a83 100755
--- a/System/File/Local/File.php
+++ b/System/File/Local/File.php
@@ -491,7 +491,7 @@ final class File extends FileAbstract implements FileInterface
*/
public function copyNode(string $to, bool $overwrite = false) : bool
{
- $newParent = $this->findNode($to);
+ $newParent = $this->findNode(\dirname($to));
$state = self::copy($this->path, $to, $overwrite);
diff --git a/System/File/Local/FileAbstract.php b/System/File/Local/FileAbstract.php
index b1ea28c0e..644a28c43 100755
--- a/System/File/Local/FileAbstract.php
+++ b/System/File/Local/FileAbstract.php
@@ -269,11 +269,11 @@ abstract class FileAbstract implements LocalContainerInterface
*
* @param string $path Path of the node
*
- * @return null|Directory
+ * @return null|Directory|File
*
* @since 1.0.0
*/
- public function findNode(string $path) : ?Directory
+ public function findNode(string $path) : null|Directory|File
{
// Change parent element
$currentPath = \explode('/', \trim($this->path, '/'));
diff --git a/tests/Ai/Ocr/Tesseract/TesseractOcrTest.php b/tests/Ai/Ocr/Tesseract/TesseractOcrTest.php
index ad81e63a5..e1c7b364d 100755
--- a/tests/Ai/Ocr/Tesseract/TesseractOcrTest.php
+++ b/tests/Ai/Ocr/Tesseract/TesseractOcrTest.php
@@ -72,7 +72,7 @@ final class TesseractOcrTest extends \PHPUnit\Framework\TestCase
{
$this->expectException(PathException::class);
- $ocr = new TesseractOcr('/invalid/path');
+ TesseractOcr::setBin('/invalid/path');
}
/**
diff --git a/tests/DataStorage/Database/Query/BuilderTest.php b/tests/DataStorage/Database/Query/BuilderTest.php
index 0defa7035..c9b2b9720 100755
--- a/tests/DataStorage/Database/Query/BuilderTest.php
+++ b/tests/DataStorage/Database/Query/BuilderTest.php
@@ -67,7 +67,7 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase
self::assertEquals($sql, $query->select('a.test')->from('a')->where('a.test', '=', 1)->toSql());
$query = new Builder($con);
- $sql = 'SELECT [a].[test] as t FROM [a] as b WHERE [a].[test] = 1;';
+ $sql = 'SELECT [a].[test] AS t FROM [a] AS b WHERE [a].[test] = 1;';
$sql = \strtr($sql, '[]', $iS . $iE);
self::assertEquals($sql, $query->selectAs('a.test', 't')->fromAs('a', 'b')->where('a.test', '=', 1)->toSql());
@@ -121,7 +121,7 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase
$iE = $con->getGrammar()->systemIdentifierEnd;
$query = new Builder($con);
- $sql = 'SELECT [a].[test] FROM [a] as b WHERE [a].[test] = 1 ORDER BY RAND() LIMIT 1;';
+ $sql = 'SELECT [a].[test] FROM [a] AS b WHERE [a].[test] = 1 ORDER BY RAND() LIMIT 1;';
$sql = \strtr($sql, '[]', $iS . $iE);
self::assertEquals($sql, $query->random('a.test')->fromAs('a', 'b')->where('a.test', '=', 1)->toSql());
}
@@ -134,7 +134,7 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase
$iE = $con->getGrammar()->systemIdentifierEnd;
$query = new Builder($con);
- $sql = 'SELECT [a].[test] FROM [a] as b ORDER BY RANDOM() LIMIT 1;';
+ $sql = 'SELECT [a].[test] FROM [a] AS b ORDER BY RANDOM() LIMIT 1;';
$sql = \strtr($sql, '[]', $iS . $iE);
self::assertEquals($sql, $query->random('a.test')->fromAs('a', 'b')->where('a.test', '=', 1)->toSql());
}
@@ -147,7 +147,7 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase
$iE = $con->getGrammar()->systemIdentifierEnd;
$query = new Builder($con);
- $sql = 'SELECT [a].[test] FROM [a] as b ORDER BY RANDOM() LIMIT 1;';
+ $sql = 'SELECT [a].[test] FROM [a] AS b ORDER BY RANDOM() LIMIT 1;';
$sql = \strtr($sql, '[]', $iS . $iE);
self::assertEquals($sql, $query->random('a.test')->fromAs('a', 'b')->where('a.test', '=', 1)->toSql());
}
@@ -160,7 +160,7 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase
$iE = $con->getGrammar()->systemIdentifierEnd;
$query = new Builder($con);
- $sql = 'SELECT TOP 1 [a].[test] FROM [a] as b ORDER BY IDX FETCH FIRST 1 ROWS ONLY;';
+ $sql = 'SELECT TOP 1 [a].[test] FROM [a] AS b ORDER BY IDX FETCH FIRST 1 ROWS ONLY;';
$sql = \strtr($sql, '[]', $iS . $iE);
self::assertEquals($sql, $query->random('a.test')->fromAs('a', 'b')->where('a.test', '=', 1)->toSql());
}
diff --git a/tests/DataStorage/Database/Schema/BuilderTest.php b/tests/DataStorage/Database/Schema/BuilderTest.php
index f5a70693e..edc19f660 100755
--- a/tests/DataStorage/Database/Schema/BuilderTest.php
+++ b/tests/DataStorage/Database/Schema/BuilderTest.php
@@ -180,7 +180,7 @@ final class BuilderTest extends \PHPUnit\Framework\TestCase
} elseif ($con instanceof SqlServerConnection) {
$sql = 'CREATE TABLE IF NOT EXISTS [user_roles] ([user_id] INT AUTO_INCREMENT, [role_id] VARCHAR(10) DEFAULT \'1\' NULL, PRIMARY KEY ([user_id]), FOREIGN KEY ([user_id]) REFERENCES [users] ([ext1_id]), FOREIGN KEY ([role_id]) REFERENCES [roles] ([ext2_id]));';
} elseif ($con instanceof SQLiteConnection) {
- $sql = 'CREATE TABLE [user_roles] ([user_id] INTEGER PRIMARY KEY AUTOINCREMENT, [role_id] TEXT DEFAULT \'1\' NULL, PRIMARY KEY ([user_id]), FOREIGN KEY ([user_id]) REFERENCES [users] ([ext1_id]), FOREIGN KEY ([role_id]) REFERENCES [roles] ([ext2_id]));';
+ $sql = 'CREATE TABLE [user_roles] ([user_id] INTEGER AUTOINCREMENT PRIMARY KEY, [role_id] TEXT DEFAULT \'1\' NULL, FOREIGN KEY ([user_id]) REFERENCES [users] ([ext1_id]), FOREIGN KEY ([role_id]) REFERENCES [roles] ([ext2_id]));';
}
$sql = \strtr($sql, '[]', $iS . $iE);
diff --git a/tests/Router/SocketRouterTest.php b/tests/Router/SocketRouterTest.php
index 6d29465b9..11c14d1c4 100755
--- a/tests/Router/SocketRouterTest.php
+++ b/tests/Router/SocketRouterTest.php
@@ -108,7 +108,7 @@ final class SocketRouterTest extends \PHPUnit\Framework\TestCase
*/
public function testDynamicRouteAdding() : void
{
- $this->router->add('^.*backends_admin -settings=general(\?.*$|$)', 'Controller:test');
+ $this->router->add('^.*backends_admin -settings=general( \-.*$|$)', 'Controller:test');
self::assertEquals(
[['dest' => 'Controller:test']],
$this->router->route('backends_admin -settings=general -t 123')
@@ -219,7 +219,7 @@ final class SocketRouterTest extends \PHPUnit\Framework\TestCase
public function testDataValidation() : void
{
$this->router->add(
- '^.*backends_admin -settings=general(\?.*$|$)',
+ '^.*backends_admin -settings=general( \-.*$|$)',
'Controller:test',
validation: ['test_pattern' => '/^[a-z]*$/']
);
@@ -238,7 +238,7 @@ final class SocketRouterTest extends \PHPUnit\Framework\TestCase
public function testInvalidDataValidation() : void
{
$this->router->add(
- '^.*backends_admin -settings=general(\?.*$|$)',
+ '^.*backends_admin -settings=general( \-.*$|$)',
'Controller:test',
validation: ['test_pattern' => '/^[a-z]*$/']
);
@@ -257,7 +257,7 @@ final class SocketRouterTest extends \PHPUnit\Framework\TestCase
public function testDataFromPattern() : void
{
$this->router->add(
- '^.*-settings=general(\?.*$|$)',
+ '^.*-settings=general( \-.*$|$)',
'Controller:test',
dataPattern: '/^.*?(settings)=([a-z]*).*?$/'
);
diff --git a/tests/Router/WebRouterTest.php b/tests/Router/WebRouterTest.php
index 041d1bd03..66865d88e 100755
--- a/tests/Router/WebRouterTest.php
+++ b/tests/Router/WebRouterTest.php
@@ -91,7 +91,7 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase
[['dest' => '\Modules\Admin\Controller:viewSettingsGeneral']],
$this->router->route(
(new HttpRequest(
- new HttpUri('http://test.com/backend/admin/settings/general/something?test')
+ new HttpUri('http://test.com/backend/admin/settings/general?test')
))->uri->getRoute()
)
);
@@ -111,7 +111,7 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase
[],
$this->router->route(
(new HttpRequest(
- new HttpUri('http://test.com/backend/admin/settings/general/something?test')
+ new HttpUri('http://test.com/backend/admin/settings/general?test')
))->uri->getRoute()
)
);
@@ -130,7 +130,7 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase
[['dest' => '\Modules\Admin\Controller:viewSettingsGeneral']],
$this->router->route(
(new HttpRequest(
- new HttpUri('http://test.com/backend/admin/settings/general/something?test')
+ new HttpUri('http://test.com/backend/admin/settings/general?test')
))->uri->getRoute(), null, RouteVerb::PUT)
);
}
@@ -147,7 +147,7 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase
[['dest' => 'Controller:test']],
$this->router->route(
(new HttpRequest(
- new HttpUri('http://test.com/backends/admin/settings/general/something?test')
+ new HttpUri('http://test.com/backends/admin/settings/general?test')
))->uri->getRoute(), null, RouteVerb::ANY)
);
@@ -155,7 +155,7 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase
[['dest' => 'Controller:test']],
$this->router->route(
(new HttpRequest(
- new HttpUri('http://test.com/backends/admin/settings/general/something?test')
+ new HttpUri('http://test.com/backends/admin/settings/general?test')
))->uri->getRoute(), null, RouteVerb::SET)
);
@@ -163,7 +163,7 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase
[['dest' => 'Controller:test']],
$this->router->route(
(new HttpRequest(
- new HttpUri('http://test.com/backends/admin/settings/general/something?test')))->uri->getRoute(), null, RouteVerb::GET)
+ new HttpUri('http://test.com/backends/admin/settings/general?test')))->uri->getRoute(), null, RouteVerb::GET)
);
}
@@ -236,7 +236,7 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase
self::assertEquals(
[['dest' => '\Modules\Admin\Controller:viewSettingsGeneral']],
$this->router->route(
- (new HttpRequest(new HttpUri('http://test.com/backend/admin/settings/general/something?test')))->uri->getRoute(),
+ (new HttpRequest(new HttpUri('http://test.com/backend/admin/settings/general?test')))->uri->getRoute(),
null,
RouteVerb::GET,
null,
@@ -300,7 +300,7 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase
self::assertNotEquals(
[['dest' => '\Modules\Admin\Controller:viewSettingsGeneral']],
$this->router->route(
- (new HttpRequest(new HttpUri('http://test.com/backend/admin/settings/general/something?test')))->uri->getRoute(),
+ (new HttpRequest(new HttpUri('http://test.com/backend/admin/settings/general?test')))->uri->getRoute(),
null,
RouteVerb::GET,
null,
@@ -329,7 +329,7 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase
[['dest' => 'Controller:test']],
$this->router->route(
(new HttpRequest(
- new HttpUri('http://test.com/backends/admin/settings/general/something?test')
+ new HttpUri('http://test.com/backends/admin/settings/general?test')
))->uri->getRoute(), null, RouteVerb::ANY, null, null, null, ['test_pattern' => 'abcdef'])
);
}
@@ -353,7 +353,7 @@ final class WebRouterTest extends \PHPUnit\Framework\TestCase
[['dest' => 'Controller:test']],
$this->router->route(
(new HttpRequest(
- new HttpUri('http://test.com/backends/admin/settings/general/something?test')
+ new HttpUri('http://test.com/backends/admin/settings/general?test')
))->uri->getRoute(), null, RouteVerb::ANY, null, null, null, ['test_pattern' => '123'])
);
}
diff --git a/tests/Router/socketRouterTestFile.php b/tests/Router/socketRouterTestFile.php
index 3a4b22f4e..f10b13da5 100755
--- a/tests/Router/socketRouterTestFile.php
+++ b/tests/Router/socketRouterTestFile.php
@@ -1,7 +1,7 @@
[
+ '^.*backend_admin -settings=general( \-.*$|$)' => [
0 => [
'dest' => '\Modules\Admin\Controller:viewSettingsGeneral',
],
diff --git a/tests/Router/socketRouterTestFilePermission.php b/tests/Router/socketRouterTestFilePermission.php
index 6e33a2e90..95988d895 100755
--- a/tests/Router/socketRouterTestFilePermission.php
+++ b/tests/Router/socketRouterTestFilePermission.php
@@ -4,7 +4,7 @@ declare(strict_types=1);
use phpOMS\Account\PermissionType;
return [
- '^.*backend_admin -settings=general(\?.*$|$)' => [
+ '^.*backend_admin -settings=general( \-.*$|$)' => [
0 => [
'dest' => '\Modules\Admin\Controller:viewSettingsGeneral',
'permission' => [
diff --git a/tests/Stdlib/Base/AddressTest.php b/tests/Stdlib/Base/AddressTest.php
index 3a5166c34..ccae59dea 100755
--- a/tests/Stdlib/Base/AddressTest.php
+++ b/tests/Stdlib/Base/AddressTest.php
@@ -42,22 +42,19 @@ final class AddressTest extends \PHPUnit\Framework\TestCase
public function testDefault() : void
{
$expected = [
- 'recipient' => '',
'fao' => '',
- 'location' => [
- 'postal' => '',
- 'city' => '',
- 'country' => 'XX',
- 'address' => '',
- 'state' => '',
- 'lat' => 0.0,
- 'lon' => 0.0,
- ],
+ 'name' => '',
+ 'postal' => '',
+ 'city' => '',
+ 'country' => 'XX',
+ 'address' => '',
+ 'state' => '',
+ 'lat' => 0.0,
+ 'lon' => 0.0,
];
- self::assertEquals('', $this->address->recipient);
self::assertEquals('', $this->address->fao);
- self::assertInstanceOf('\phpOMS\Stdlib\Base\Location', $this->address->location);
+ self::assertInstanceOf('\phpOMS\Stdlib\Base\Location', $this->address);
self::assertEquals($expected, $this->address->toArray());
self::assertEquals($expected, $this->address->jsonSerialize());
}
@@ -73,29 +70,6 @@ final class AddressTest extends \PHPUnit\Framework\TestCase
self::assertEquals('fao', $this->address->fao);
}
- /**
- * @testdox The recipient can be set and returned
- * @covers phpOMS\Stdlib\Base\Address
- * @group framework
- */
- public function testRecipientInputOutput() : void
- {
- $this->address->recipient = 'recipient';
- self::assertEquals('recipient', $this->address->recipient);
- }
-
- /**
- * @testdox The location can be set and returned
- * @covers phpOMS\Stdlib\Base\Address
- * @group framework
- */
- public function testLocationInputOutput() : void
- {
- $this->address->location = new Location();
-
- self::assertInstanceOf('\phpOMS\Stdlib\Base\Location', $this->address->location);
- }
-
/**
* @testdox The address can be turned into array data
* @covers phpOMS\Stdlib\Base\Address
@@ -104,22 +78,18 @@ final class AddressTest extends \PHPUnit\Framework\TestCase
public function testArray() : void
{
$expected = [
- 'recipient' => 'recipient',
'fao' => 'fao',
- 'location' => [
- 'postal' => '',
- 'city' => '',
- 'country' => 'XX',
- 'address' => '',
- 'state' => '',
- 'lat' => 0.0,
- 'lon' => 0.0,
- ],
+ 'name' => '',
+ 'postal' => '',
+ 'city' => '',
+ 'country' => 'XX',
+ 'address' => '',
+ 'state' => '',
+ 'lat' => 0.0,
+ 'lon' => 0.0,
];
$this->address->fao = 'fao';
- $this->address->recipient = 'recipient';
- $this->address->location = new Location();
self::assertEquals($expected, $this->address->toArray());
}
@@ -132,22 +102,18 @@ final class AddressTest extends \PHPUnit\Framework\TestCase
public function testJsonSerialize() : void
{
$expected = [
- 'recipient' => 'recipient',
'fao' => 'fao',
- 'location' => [
- 'postal' => '',
- 'city' => '',
- 'country' => 'XX',
- 'address' => '',
- 'state' => '',
- 'lat' => 0.0,
- 'lon' => 0.0,
- ],
+ 'name' => '',
+ 'postal' => '',
+ 'city' => '',
+ 'country' => 'XX',
+ 'address' => '',
+ 'state' => '',
+ 'lat' => 0.0,
+ 'lon' => 0.0,
];
$this->address->fao = 'fao';
- $this->address->recipient = 'recipient';
- $this->address->location = new Location();
self::assertEquals($expected, $this->address->jsonSerialize());
}
diff --git a/tests/Utils/Parser/Document/data/WordMpdf.pdf b/tests/Utils/Parser/Document/data/WordMpdf.pdf
new file mode 100644
index 000000000..876d6e127
Binary files /dev/null and b/tests/Utils/Parser/Document/data/WordMpdf.pdf differ
diff --git a/tests/Utils/Parser/Markdown/data/chartjs.md b/tests/Utils/Parser/Markdown/data/chartjs.md
index 6ff76ccd9..b532b98c9 100644
--- a/tests/Utils/Parser/Markdown/data/chartjs.md
+++ b/tests/Utils/Parser/Markdown/data/chartjs.md
@@ -1,2 +1,2 @@
-```chart
+```chartjs
```
\ No newline at end of file
diff --git a/tests/Utils/Parser/Spreadsheet/data/ExcelMpdf.pdf b/tests/Utils/Parser/Spreadsheet/data/ExcelMpdf.pdf
new file mode 100644
index 000000000..8553592ce
Binary files /dev/null and b/tests/Utils/Parser/Spreadsheet/data/ExcelMpdf.pdf differ
diff --git a/tests/Utils/StringUtilsTest.php b/tests/Utils/StringUtilsTest.php
index 531266491..742066d88 100755
--- a/tests/Utils/StringUtilsTest.php
+++ b/tests/Utils/StringUtilsTest.php
@@ -193,7 +193,7 @@ final class StringUtilsTest extends \PHPUnit\Framework\TestCase
);
self::assertEquals(
- 'This is a testnew string.',
+ 'This is a test new string.',
StringUtils::createDiffMarkup($original, $new, ' ')
);