FunctionalTestCase.php 756 Bytes
Newer Older
1 2 3 4 5
<?php

namespace MongoDB\Tests\Collection;

use MongoDB\Collection;
6
use MongoDB\Driver\WriteConcern;
7
use MongoDB\Tests\FunctionalTestCase as BaseFunctionalTestCase;
8
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
9 10 11 12 13 14

/**
 * Base class for Collection functional tests.
 */
abstract class FunctionalTestCase extends BaseFunctionalTestCase
{
15 16
    use SetUpTearDownTrait;

17 18
    protected $collection;

19
    private function doSetUp()
20 21 22
    {
        parent::setUp();

23
        $this->collection = new Collection($this->manager, $this->getDatabaseName(), $this->getCollectionName());
24 25

        $this->dropCollection();
26 27
    }

28
    private function doTearDown()
29 30 31 32 33
    {
        if ($this->hasFailed()) {
            return;
        }

34 35
        $this->dropCollection();
    }
36
}