Skip to content

Commit

Permalink
test adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
koertho committed Mar 1, 2024
1 parent 1c480b4 commit 9445ecb
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions tests/EventListener/DcaField/DateAddedFieldListenerTest.php
Expand Up @@ -4,13 +4,16 @@

use Contao\DataContainer;
use Contao\Model;
use HeimrichHannot\TestUtilitiesBundle\Mock\ModelMockTrait;
use HeimrichHannot\UtilsBundle\Dca\DateAddedField;
use HeimrichHannot\UtilsBundle\EventListener\DcaField\DateAddedFieldListener;
use PHPUnit\Framework\TestCase;
use Psr\Container\ContainerInterface;

class DateAddedFieldListenerTest extends TestCase
{
use ModelMockTrait;

/**
* @runInSeparateProcess
*/
Expand Down Expand Up @@ -88,10 +91,7 @@ public function testOnLoadCallback()
->onlyMethods(['getModelInstance'])
->getMock();

$model = $this->getMockBuilder(Model::class)
->disableOriginalConstructor()
->onlyMethods(['save'])
->getMock();
$model = $this->mockModelObject(Model::class);

$model->dateAdded = 0;

Expand Down Expand Up @@ -169,10 +169,7 @@ public function testOnCopyCallback()
}
});

$model = $this->getMockBuilder(Model::class)
->disableOriginalConstructor()
->onlyMethods(['save'])
->getMock();
$model = $this->mockModelObject(Model::class);

$model->dateAdded = 0;

Expand Down

0 comments on commit 9445ecb

Please sign in to comment.