This repository has been archived on 2022-07-12. You can view files and clone it, but cannot push or open issues or pull requests.
opencase/tests/src/Unit/HookHelperTest.php

16 lines
594 B
PHP

<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;
include '../../../modules/opencase_cases/src/Entity/OCCase.php';
final class HookHelperTest extends TestCase
{
public function testOnCaseFeeUpdate(): void
{
$caseStub = $this->createStub(\Drupal\opencase_cases\Entity\OCCase::class);
$caseStub->total_fee = 5;
$caseFeeStub = $this->createStub(\Drupal\opencase_cases\Entity\OCCaseFee::class);
$caseFeeStub->amount = 10;
$caseFeeStub->method('getCase')->will($this->returnValue($caseStub));
$this->assertSame(5,5);
}
}