Skip to content

Commit

Permalink
Unit test for file action
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianallgeier committed Jan 22, 2024
1 parent 3998fad commit 7b47bd1
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/Cms/Files/FileActionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,33 @@ public function testCreate($parent)
$this->assertIsString($result->content()->get('uuid')->value());
}

/**
* @dataProvider parentProvider
*/
public function testCreateDuplicate($parent)
{
$source = static::TMP . '/source.md';

// create the dummy source
F::write($source, '# Test');

$result = File::create([
'filename' => 'test.md',
'source' => $source,
'parent' => $parent
]);

$uuid = $result->content()->get('uuid')->value();

$duplicate = File::create([
'filename' => 'test.md',
'source' => $source,
'parent' => $parent
]);

$this->assertSame($uuid, $duplicate->content()->get('uuid')->value());
}

/**
* @dataProvider parentProvider
*/
Expand Down

0 comments on commit 7b47bd1

Please sign in to comment.