vendor/doctrine-fixtures/tests/Doctrine/Tests/Common/DataFixtures/FixtureTest.php
changeset 58 624e5900f5a4
equal deleted inserted replaced
57:b36a42d260d8 58:624e5900f5a4
       
     1 <?php
       
     2 /*
       
     3  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
       
     4  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
       
     5  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
       
     6  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
       
     7  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
       
     8  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
       
     9  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
       
    10  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
       
    11  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
       
    12  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
       
    13  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
       
    14  *
       
    15  * This software consists of voluntary contributions made by many individuals
       
    16  * and is licensed under the LGPL. For more information, see
       
    17  * <http://www.doctrine-project.org>.
       
    18  */
       
    19 
       
    20 namespace Doctrine\Tests\Common\DataFixtures;
       
    21 
       
    22 require_once __DIR__.'/TestInit.php';
       
    23 
       
    24 use Doctrine\Common\DataFixtures\FixtureInterface;
       
    25 
       
    26 /**
       
    27  * Test Fixture interface.
       
    28  *
       
    29  * @author Jonathan H. Wage <jonwage@gmail.com>
       
    30  */
       
    31 class FixtureTest extends BaseTest
       
    32 {
       
    33     public function testFixtureInterface()
       
    34     {
       
    35         $em = $this->getMockEntityManager();
       
    36         $fixture = new MyFixture2();
       
    37         $fixture->load($em);
       
    38 
       
    39         $this->assertTrue($fixture->loaded);
       
    40     }
       
    41 }
       
    42 
       
    43 class MyFixture2 implements FixtureInterface
       
    44 {
       
    45     public $loaded = false;
       
    46 
       
    47     public function load($manager)
       
    48     {
       
    49         $this->loaded = true;
       
    50     }
       
    51 }