CakeAccounting/tests/TestCase/Model/Table/DeJournalsTableTest.php

96 lines
2.3 KiB
PHP
Raw Permalink 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\DeJournalsTable;
/**
* CakeAccounting\Model\Table\DeJournalsTable Test Case
*/
class DeJournalsTableTest extends TestCase
{
/**
* Test subject
*
* @var \CakeAccounting\Model\Table\DeJournalsTable
*/
protected $DeJournals;
/**
* Fixtures
*
* @var array<string>
*/
protected array $fixtures = [
'plugin.CakeAccounting.DeJournals',
'plugin.CakeAccounting.DeJournalEntries',
];
/**
* setUp method
*
* @return void
*/
protected function setUp(): void
{
parent::setUp();
$config = $this->getTableLocator()->exists('DeJournals') ? [] : ['className' => DeJournalsTable::class];
$this->DeJournals = $this->getTableLocator()->get('DeJournals', $config);
}
/**
* tearDown method
*
* @return void
*/
protected function tearDown(): void
{
unset($this->DeJournals);
parent::tearDown();
}
/**
* TestInitialize method
*
* @return void
* @uses \CakeAccounting\Model\Table\DeJournalsTable::initialize()
*/
public function testInitialize(): void
{
// verify all associations loaded
$expectedAssociations = [
'DeJournalTypes',
'DeJournalEntries',
];
$associations = $this->DeJournals->associations();
$this->assertCount(count($expectedAssociations), $associations);
foreach ($expectedAssociations as $expectedAssociation) {
$this->assertTrue($this->DeJournals->hasAssociation($expectedAssociation));
}
// verify all behaviors loaded
$expectedBehaviors = [];
$behaviors = $this->DeJournals->behaviors();
$this->assertCount(count($expectedBehaviors), $behaviors);
foreach ($expectedBehaviors as $expectedBehavior) {
$this->assertTrue($this->DeJournals->hasBehavior($expectedBehavior));
}
}
/**
* Test validationDefault method
*
* @return void
* @uses \CakeAccounting\Model\Table\DeJournalsTable::validationDefault()
*/
public function testValidationDefault(): void
{
$this->markTestIncomplete('Not implemented yet.');
}
}