Skip to content

Commit

Permalink
Merge pull request #3954 from thangnnmd/unitTest_BcContentsBehavior_o…
Browse files Browse the repository at this point in the history
…nAlias

BcContentsBehavior::onAlias
  • Loading branch information
HungDV2022 authored Oct 29, 2024
2 parents b6f61c5 + 2a8c584 commit d28c946
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public function offAlias(): void
* アソシエーション時に alias を含める
* @checked
* @noTodo
* @unitTest
*/
public function onAlias(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public function setUp(): void
$this->table->setPrimaryKey(['id']);
$this->table->addBehavior('BaserCore.BcContents');
$this->contentService = new ContentsService();
$this->BcContentsBehavior = new BcContentsBehavior($this->table);
}

/**
Expand Down Expand Up @@ -200,4 +201,17 @@ public function testAfterDelete()

}

/**
* test onAlias
*/
public function testOnAlias()
{
$this->BcContentsBehavior->onAlias();

$conditions = $this->BcContentsBehavior->Contents->getConditions();

$this->assertArrayHasKey('Contents.type', $conditions);
$this->assertEquals('ContentFolder', $conditions['Contents.type']);
}

}

0 comments on commit d28c946

Please sign in to comment.