This repository has been archived by the owner on Aug 29, 2020. It is now read-only.
-
-
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.
Merge pull request #3 from localheinz/fix/private
Fix: Ignore definitions with private constructors
- Loading branch information
Showing
3 changed files
with
42 additions
and
1 deletion.
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
30 changes: 30 additions & 0 deletions
30
test/Unit/Asset/Definition/PrivateConstructor/UserDefinition.php
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,30 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright (c) 2017 Andreas Möller | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE file that was distributed with this source code. | ||
* | ||
* @link https://github.com/localheinz/factory-girl-definition | ||
*/ | ||
|
||
namespace Localheinz\FactoryGirl\Definition\Test\Unit\Asset\Definition\PrivateConstructor; | ||
|
||
use FactoryGirl\Provider\Doctrine\FixtureFactory; | ||
use Localheinz\FactoryGirl\Definition\Definition; | ||
|
||
/** | ||
* Is not acceptable as it has a private constructor. | ||
*/ | ||
final class UserDefinition implements Definition | ||
{ | ||
private function __construct() | ||
{ | ||
} | ||
|
||
public function accept(FixtureFactory $factory) | ||
{ | ||
$factory->defineEntity('Foo'); | ||
} | ||
} |
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