CakeAccounting/tests/TestCase/Model/Table/DeExternalAccountsTableTest...

97 lines
2.4 KiB
PHP
Raw Normal View History

2025-08-09 21:07:39 +00:00
<?php
declare(strict_types=1);
namespace CakeAccounting\Test\TestCase\Model\Table;
use Cake\TestSuite\TestCase;
use CakeAccounting\Model\Table\DeExternalAccountsTable;
/**
* CakeAccounting\Model\Table\DeExternalAccountsTable Test Case
*/
class DeExternalAccountsTableTest extends TestCase
{
/**
* Test subject
*
* @var \CakeAccounting\Model\Table\DeExternalAccountsTable
*/
protected $DeExternalAccounts;
/**
* Fixtures
*
* @var array<string>
*/
protected array $fixtures = [
'plugin.CakeAccounting.DeExternalAccounts',
];
/**
* setUp method
*
* @return void
*/
protected function setUp(): void
{
parent::setUp();
$config = $this->getTableLocator()->exists('DeExternalAccounts') ? [] : ['className' => DeExternalAccountsTable::class];
$this->DeExternalAccounts = $this->getTableLocator()->get('DeExternalAccounts', $config);
}
/**
* tearDown method
*
* @return void
*/
protected function tearDown(): void
{
unset($this->DeExternalAccounts);
parent::tearDown();
}
/**
* TestInitialize method
*
* @return void
* @uses \CakeAccounting\Model\Table\DeExternalAccountsTable::initialize()
*/
public function testInitialize(): void
{
// verify all associations loaded
$expectedAssociations = [
'DeExternalAccountStatements',
'DeEntityTypes',
];
$associations = $this->DeExternalAccounts->associations();
$this->assertCount(count($expectedAssociations), $associations);
foreach ($expectedAssociations as $expectedAssociation) {
$this->assertTrue($this->DeExternalAccounts->hasAssociation($expectedAssociation));
}
// verify all behaviors loaded
$expectedBehaviors = [
'Timestamp',
];
$behaviors = $this->DeExternalAccounts->behaviors();
$this->assertCount(count($expectedBehaviors), $behaviors);
foreach ($expectedBehaviors as $expectedBehavior) {
$this->assertTrue($this->DeExternalAccounts->hasBehavior($expectedBehavior));
}
}
/**
* Test validationDefault method
*
* @return void
* @uses \CakeAccounting\Model\Table\DeExternalAccountsTable::validationDefault()
*/
public function testValidationDefault(): void
{
$this->markTestIncomplete('Not implemented yet.');
}
}