-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9cb7949
commit d4d8e0d
Showing
4 changed files
with
108 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright © Fastbolt Schraubengroßhandels GmbH. | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Fastbolt\EntityImporter\Tests\Unit\Events; | ||
|
||
use DateTime; | ||
use Exception; | ||
use Fastbolt\EntityImporter\EntityImporterDefinition; | ||
use Fastbolt\EntityImporter\Events\ImportFailureEvent; | ||
use Fastbolt\TestHelpers\BaseTestCase; | ||
use PHPUnit\Framework\MockObject\MockObject; | ||
|
||
/** | ||
* @covers \Fastbolt\EntityImporter\Events\ImportFailureEvent | ||
*/ | ||
class ImportFailureEventTest extends BaseTestCase | ||
{ | ||
/** | ||
* @var Exception|MockObject | ||
*/ | ||
private $exception; | ||
|
||
/** | ||
* @var EntityImporterDefinition|MockObject | ||
*/ | ||
private $definition; | ||
|
||
public function testEvent(): void | ||
{ | ||
$event = new ImportFailureEvent($this->definition, $start = new DateTime(), $this->exception); | ||
|
||
self::assertSame($this->definition, $event->getDefinition()); | ||
self::assertSame($start, $event->getImportStart()); | ||
self::assertSame($this->exception, $event->getException()); | ||
} | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->exception = $this->getMock(Exception::class); | ||
$this->definition = $this->getMock(EntityImporterDefinition::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,47 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright © Fastbolt Schraubengroßhandels GmbH. | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Fastbolt\EntityImporter\Tests\Unit\Events; | ||
|
||
use DateTime; | ||
use Fastbolt\EntityImporter\EntityImporterDefinition; | ||
use Fastbolt\EntityImporter\Events\ImportSuccessEvent; | ||
use Fastbolt\EntityImporter\Types\ImportResult; | ||
use Fastbolt\TestHelpers\BaseTestCase; | ||
use PHPUnit\Framework\MockObject\MockObject; | ||
|
||
/** | ||
* @covers \Fastbolt\EntityImporter\Events\ImportSuccessEvent | ||
*/ | ||
class ImportSuccessEventTest extends BaseTestCase | ||
{ | ||
/** | ||
* @var ImportResult|MockObject | ||
*/ | ||
private $importResult; | ||
|
||
/** | ||
* @var EntityImporterDefinition|MockObject | ||
*/ | ||
private $definition; | ||
|
||
public function testEvent(): void | ||
{ | ||
$event = new ImportSuccessEvent($this->definition, $start = new DateTime(), $this->importResult); | ||
|
||
class ImportSuccessEventTest extends BaseTestCase { | ||
self::assertSame($this->definition, $event->getDefinition()); | ||
self::assertSame($this->importResult, $event->getImportResult()); | ||
self::assertSame($start, $event->getImportStart()); | ||
} | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->importResult = $this->getMock(ImportResult::class); | ||
$this->definition = $this->getMock(EntityImporterDefinition::class); | ||
} | ||
} |