CakeContactUs/tests/TestCase/Model/Table/ContactUsFormSubmissionsTab...

92 lines
2.4 KiB
PHP
Raw Normal View History

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