Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Apr 16, 2024
1 parent e540acf commit 413d4c4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
4 changes: 2 additions & 2 deletions tests/Fixture/ArticlesFixture.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Muffin\Trash\Test\Fixture;

use Cake\I18n\Time;
use Cake\I18n\DateTime;
use Cake\TestSuite\Fixture\TestFixture;

class ArticlesFixture extends TestFixture
Expand All @@ -21,7 +21,7 @@ class ArticlesFixture extends TestFixture

public function init(): void
{
$created = $modified = new Time();
$created = $modified = new DateTime();
array_walk($this->records, function (&$record) use ($created, $modified) {
$record += compact('created', 'modified');
});
Expand Down
18 changes: 8 additions & 10 deletions tests/TestCase/Model/Behavior/TrashBehaviorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,32 @@
use Cake\I18n\DateTime;
use Cake\ORM\Association\HasMany;
use Cake\ORM\Entity;
use Cake\ORM\Table;
use Cake\TestSuite\TestCase;
use InvalidArgumentException;
use Muffin\Trash\Model\Behavior\TrashBehavior;

/**
* @property \Cake\ORM\Table Users
* @property \Cake\ORM\Table CompositeArticlesUsers
* @property \Cake\ORM\Table Comments
* @property \Cake\ORM\Table Articles
* @property \Muffin\Trash\Model\Behavior\TrashBehavior Behavior
*
* @property \Cake\ORM\Table @mixin \Muffin\Trash\Model\Behavior\TrashBehavior
*/
class TrashBehaviorTest extends TestCase
{
/**
* Fixtures to load.
*
* @var array
*/
public array $fixtures = [
protected array $fixtures = [
'plugin.Muffin/Trash.Articles',
'plugin.Muffin/Trash.Comments',
'plugin.Muffin/Trash.Users',
'plugin.Muffin/Trash.ArticlesUsers',
'plugin.Muffin/Trash.CompositeArticlesUsers',
];

protected Table $Users;
protected Table $CompositeArticlesUsers;
protected Table $Comments;
protected Table $Articles;
protected TrashBehavior $Behavior;

/**
* Runs before each test.
*
Expand Down
3 changes: 0 additions & 3 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,3 @@

require $root . '/vendor/cakephp/cakephp/tests/bootstrap.php';

Check failure on line 33 in tests/bootstrap.php

View workflow job for this annotation

GitHub Actions / cs-stan / Coding Standard & Static Analysis

Expected 1 blank line at end of file; 2 found

Configure::write('Error.ignoredDeprecationPaths', [
'src/TestSuite/Fixture/FixtureInjector.php',
]);

0 comments on commit 413d4c4

Please sign in to comment.