diff --git a/examples/PizzaTraitTest.php b/examples/PizzaTraitTest.php index fb3e77c..47d161a 100644 --- a/examples/PizzaTraitTest.php +++ b/examples/PizzaTraitTest.php @@ -10,24 +10,24 @@ class PizzaTraitTest extends \PHPUnit_Framework_TestCase { use \Zumba\PHPUnit\Extensions\Mongo\TestTrait; - /** - * Default Database name - */ + /** + * Default Database name + */ const DEFAULT_DATABASE = 'mongounit_test'; - /** - * @var Connector - */ + /** + * @var \Zumba\PHPUnit\Extensions\Mongo\Client\Connector + */ protected $connection; - /** - * @var DataSet - */ + /** + * @var \Zumba\PHPUnit\Extensions\Mongo\DataSet\DataSet + */ protected $dataSet; - /** - * @var array - */ + /** + * @var array + */ protected $fixture = [ 'orders' => [ ['size' => 'large', 'toppings' => ['cheese', 'ham']], @@ -35,9 +35,9 @@ class PizzaTraitTest extends \PHPUnit_Framework_TestCase { ] ]; - /** - * @return Connector - */ + /** + * @return \Zumba\PHPUnit\Extensions\Mongo\Client\Connector + */ public function getMongoConnection() { if (empty($this->connection)) { $this->connection = new Connector(new \MongoClient()); @@ -46,9 +46,9 @@ public function getMongoConnection() { return $this->connection; } - /** - * @return DataSet - */ + /** + * @return \Zumba\PHPUnit\Extensions\Mongo\DataSet\DataSet + */ public function getMongoDataSet() { if (empty($this->dataSet)) { $this->dataSet = new DataSet($this->getMongoConnection()); diff --git a/src/DataSet/DataSet.php b/src/DataSet/DataSet.php index a758c31..2a605f1 100644 --- a/src/DataSet/DataSet.php +++ b/src/DataSet/DataSet.php @@ -21,37 +21,37 @@ class DataSet { /** * Connection object. * - * @var Connector + * @var \Zumba\PHPUnit\Extensions\Mongo\Client\Connector */ protected $connection; - /** - * Constructor. - * - * @param Connector $connection - */ + /** + * Constructor. + * + * @param \Zumba\PHPUnit\Extensions\Mongo\Client\Connector $connection + */ public function __construct(Connector $connection) { $this->connection = $connection; } - /** - * Sets up the fixture data. - * - * see $this->fixture - * - * @param array $data - * @return $this - */ + /** + * Sets up the fixture data. + * + * see $this->fixture + * + * @param array $data + * @return $this + */ public function setFixture(array $data) { $this->fixture = $data; return $this; } - /** - * Drops all collections specified in the fixture keys. - * - * @return $this - */ + /** + * Drops all collections specified in the fixture keys. + * + * @return $this + */ public function dropAllCollections() { foreach ($this->fixture as $collectionKey => $collectionData) { $this->connection->collection($collectionKey)->drop(); @@ -59,11 +59,11 @@ public function dropAllCollections() { return $this; } - /** - * Creates all collections with data from the fixture. - * - * @return $this - */ + /** + * Creates all collections with data from the fixture. + * + * @return $this + */ public function buildCollections() { foreach ($this->fixture as $collection => $data) { foreach ($data as $entry) { diff --git a/src/TestTrait.php b/src/TestTrait.php index c3cde1c..7538212 100644 --- a/src/TestTrait.php +++ b/src/TestTrait.php @@ -1,8 +1,6 @@ getMongoDataSet()->dropAllCollections(); } - /** - * Retrieve a mongo connection client. - * - * @return Connector - */ + /** + * Retrieve a mongo connection client. + * + * @return \Zumba\PHPUnit\Extensions\Mongo\Client\Connector + */ protected abstract function getMongoConnection(); - /** - * Retrieve a DataSet object. - * - * @return DataSet - */ + /** + * Retrieve a DataSet object. + * + * @return \Zumba\PHPUnit\Extensions\Mongo\DataSet\DataSet + */ protected abstract function getMongoDataSet(); }