invoiceninja/tests/Unit/GroupTest.php

45 lines
854 B
PHP
Raw Normal View History

2019-09-09 21:05:53 +10:00
<?php
namespace Tests\Unit;
use App\DataMapper\ClientSettings;
use App\DataMapper\CompanySettings;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\TestCase;
/**
* @test
*/
class GroupTest extends TestCase
{
public function setUp() :void
{
2019-09-09 21:24:22 +10:00
parent::setUp();
2019-09-09 21:05:53 +10:00
2019-09-19 15:50:05 +10:00
$this->settings = ClientSettings::buildClientSettings(CompanySettings::defaults(), ClientSettings::defaults());
2019-09-09 21:05:53 +10:00
}
public function testGroupsPropertiesExistsResponses()
{
2019-09-09 21:24:22 +10:00
2019-09-10 12:30:43 +10:00
$this->assertTrue(property_exists($this->settings, 'design'));
2019-09-09 21:05:53 +10:00
}
public function testPropertyValueAccessors()
{
2019-09-10 12:30:43 +10:00
$this->settings->translations = (object) ['hello' => 'world'];
2019-09-09 21:05:53 +10:00
2019-09-10 12:30:43 +10:00
$this->assertEquals('world', $this->settings->translations->hello);
2019-09-09 21:05:53 +10:00
}
public function testPropertyIsSet()
{
2019-09-10 12:30:43 +10:00
$this->assertFalse(isset($this->settings->translations->nope));
2019-09-09 21:05:53 +10:00
}
}