1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 15:13:29 +01:00
invoiceninja/tests/Unit/PrimaryKeyTransformationTest.php
David Bomba cdc3ef12c2
Include Horizon (#3519)
* Fixes for white label

* Include Laravel Horizon

* Add Account ID to user table AND ensure a user cannot create an invoice across companies

* restart horison after an update

* Fixes for app setup

* Minor fixes

* Fixes for client routes

* Fixes for tests

* minor fixes
2020-03-24 20:15:30 +11:00

44 lines
908 B
PHP

<?php
namespace Tests\Unit;
use App\DataMapper\ClientSettings;
use App\DataMapper\CompanySettings;
use App\Utils\Traits\MakesHash;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\TestCase;
/**
* @test
* @covers App\Utils\Traits\MakesHash
*/
class PrimaryKeyTransformationTest extends TestCase
{
use MakesHash;
public function setUp() :void
{
parent::setUp();
}
public function testTransformationArray()
{
$keys = [
$this->encodePrimaryKey(310), $this->encodePrimaryKey(311)
];
$transformed_keys = $this->transformKeys($keys);
$this->assertEquals(310, $transformed_keys[0]);
$this->assertEquals(311, $transformed_keys[1]);
}
public function testTransformation()
{
$keys = $this->encodePrimaryKey(310);
$this->assertEquals(310, $this->transformKeys($keys));
}
}