Skip to content

Commit

Permalink
updating unit test with recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jturbide committed Feb 22, 2024
1 parent 6df11db commit 8e8817b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
6 changes: 3 additions & 3 deletions tests/Unit/AbstractUnit.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@

namespace Zemit\Tests\Unit;

use Phalcon\Autoload\Loader;
use Phalcon\Db\Adapter\Pdo\Mysql;
use PHPUnit\Framework\TestCase;
use Phalcon\Di\DiInterface;
use PHPUnit\Framework\TestCase;
use Zemit\Bootstrap;
use Zemit\Bootstrap\Config;
use Zemit\Exception;
use Zemit\Utils\Env;
use Phalcon\Autoload\Loader;
use Zemit\Support\Env;

/**
* Class AbstractUnitTest
Expand Down
17 changes: 11 additions & 6 deletions tests/Unit/UtilsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

namespace Zemit\Tests\Unit;

//use Zemit\Utils\Transform;
use Zemit\Utils;
use Zemit\Utils\Transform;
use Zemit\Support\Helper;
use Zemit\Support\HelperFactory;
use Zemit\Support\Utils;

/**
* Class ProviderTest
Expand Down Expand Up @@ -139,7 +139,12 @@ public function testProvider(): void
foreach ($collection as $key => $item) {
$this->assertEquals(
$item['assert'],
Transform::flattenKeys($item['transform']),
Helper::flattenKeys($item['transform']),
'Transform::flattenKeys failed for key `' . $key . '`'
);
$this->assertEquals(
$item['assert'],
(new HelperFactory())->flattenKeys($item['transform']),
'Transform::flattenKeys failed for key `' . $key . '`'
);
}
Expand All @@ -160,7 +165,7 @@ public function testGetNamespace(): void
$this->assertEquals(__NAMESPACE__, $namespace);

$namespace = Utils::getNamespace(new Utils());
$this->assertEquals('Zemit', $namespace);
$this->assertEquals('Zemit\\Support', $namespace);
}

public function testGetDirname(): void
Expand All @@ -170,7 +175,7 @@ public function testGetDirname(): void
$this->assertEquals(__DIR__, $dirname);

$dirname = Utils::getDirname(new Utils());
$this->assertEquals(dirname(__DIR__, 2) . '/src', $dirname);
$this->assertEquals(dirname(__DIR__, 2) . '/src/Support', $dirname);
}

public function testGetMemoryUsage(): void
Expand Down

0 comments on commit 8e8817b

Please sign in to comment.