Skip to content

Commit

Permalink
ユニットテスト調整 (#3400)
Browse files Browse the repository at this point in the history
Co-authored-by: Đỗ Văn Hùng <[email protected]>
  • Loading branch information
HungDV2022 and dovanhung authored May 8, 2024
1 parent a813080 commit a8f6241
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/**
* CustomFieldsTableTest
* @property CustomFieldsTable $customFieldsTable
* @property CustomFieldsTable $CustomFieldsTable
*/
class CustomFieldsTableTest extends BcTestCase
{
Expand All @@ -34,15 +34,15 @@ class CustomFieldsTableTest extends BcTestCase
public function setUp(): void
{
parent::setUp();
$this->customFieldsTable = $this->getTableLocator()->get('BcCustomContent.CustomFields');
$this->CustomFieldsTable = $this->getTableLocator()->get('BcCustomContent.CustomFields');
}

/**
* Tear down
*/
public function tearDown(): void
{
unset($this->customFieldsTable);
unset($this->CustomFieldsTable);
parent::tearDown();
}

Expand All @@ -51,8 +51,8 @@ public function tearDown(): void
*/
public function test_initialize()
{
$this->assertTrue($this->customFieldsTable->hasBehavior('Timestamp'));
$this->assertTrue($this->customFieldsTable->hasAssociation('CustomLinks'));
$this->assertTrue($this->CustomFieldsTable->hasBehavior('Timestamp'));
$this->assertTrue($this->CustomFieldsTable->hasAssociation('CustomLinks'));
}

/**
Expand Down Expand Up @@ -132,7 +132,7 @@ public function test_beforeMarshal()
];
$options = new \ArrayObject();
$content = new \ArrayObject($data);
$this->customFieldsTable->dispatchEvent('Model.beforeMarshal', ['entity' => $content, 'options' => $options]);
$this->CustomFieldsTable->dispatchEvent('Model.beforeMarshal', ['entity' => $content, 'options' => $options]);
$this->assertEquals('{"test":"test"}', $content['meta']);
$this->assertEquals('{"test":"test"}', $content['validate']);
//case false
Expand All @@ -142,7 +142,7 @@ public function test_beforeMarshal()
];
$options = new \ArrayObject();
$content = new \ArrayObject($data);
$this->customFieldsTable->dispatchEvent('Model.beforeMarshal', ['entity' => $content, 'options' => $options]);
$this->CustomFieldsTable->dispatchEvent('Model.beforeMarshal', ['entity' => $content, 'options' => $options]);
$this->assertEquals('', $content['meta']);
$this->assertEquals('', $content['validate']);
}
Expand Down

0 comments on commit a8f6241

Please sign in to comment.