diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 6136cca0a..000000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -github: jenssegers -tidelift: "packagist/jenssegers/mongodb" diff --git a/CHANGELOG.md b/CHANGELOG.md index 3dbdee597..962d4aa03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,10 @@ # Changelog All notable changes to this project will be documented in this file. -## [Unreleased] +## [4.0.0] - unreleased +- Rename package to `mongodb/laravel-mongodb` +- Change namespace to `MongoDB\Laravel` - Add classes to cast `ObjectId` and `UUID` instances [#1](https://github.com/GromNaN/laravel-mongodb/pull/1) by [@alcaeus](https://github.com/alcaeus). - Add `Query\Builder::toMql()` to simplify comprehensive query tests [#6](https://github.com/GromNaN/laravel-mongodb/pull/6) by [@GromNaN](https://github.com/GromNaN). - Fix `Query\Builder::whereNot` to use MongoDB [`$not`](https://www.mongodb.com/docs/manual/reference/operator/query/not/) operator [#13](https://github.com/GromNaN/laravel-mongodb/pull/13) by [@GromNaN](https://github.com/GromNaN). diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 61f005408..f4552fe59 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,84 +1,6 @@ -# Contributor Covenant Code of Conduct +# MongoDB Code of Conduct -## Our Pledge +The Code of Conduct outlines the expectations for our behavior as members of the MongoDB community. +We value the participation of each member of the MongoDB community and want all participants to have an enjoyable and fulfilling experience. -We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience -* Focusing on what is best not just for us as individuals, but for the overall community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at hello@jenssegers.com. All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series of actions. - -**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, -available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. \ No newline at end of file +Thanks for reading the [MongoDB Code of Conduct](https://www.mongodb.com/community-code-of-conduct). diff --git a/LICENSE.md b/LICENSE similarity index 97% rename from LICENSE.md rename to LICENSE index 948b1b1bd..4962cfa56 100644 --- a/LICENSE.md +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 Jens Segers +Copyright (c) 2023 MongoDB, Inc Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index f00b3a2c7..5fc9a203a 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ Laravel MongoDB =============== -[![Latest Stable Version](http://img.shields.io/github/release/jenssegers/laravel-mongodb.svg)](https://packagist.org/packages/jenssegers/mongodb) -[![Total Downloads](http://img.shields.io/packagist/dm/jenssegers/mongodb.svg)](https://packagist.org/packages/jenssegers/mongodb) -[![Build Status](https://img.shields.io/github/workflow/status/jenssegers/laravel-mongodb/CI)](https://github.com/jenssegers/laravel-mongodb/actions) -[![codecov](https://codecov.io/gh/jenssegers/laravel-mongodb/branch/master/graph/badge.svg)](https://codecov.io/gh/jenssegers/laravel-mongodb/branch/master) -[![Donate](https://img.shields.io/badge/donate-paypal-blue.svg)](https://www.paypal.me/jenssegers) +[![Latest Stable Version](http://img.shields.io/github/release/mongodb/laravel-mongodb.svg)](https://packagist.org/packages/mongodb/laravel-mongodb) +[![Total Downloads](http://img.shields.io/packagist/dm/mongodb/laravel-mongodb.svg)](https://packagist.org/packages/mongodb/laravel-mongodb) +[![Build Status](https://img.shields.io/github/workflow/status/mongodb/laravel-mongodb/CI)](https://github.com/mongodb/laravel-mongodb/actions) +[![codecov](https://codecov.io/gh/mongodb/laravel-mongodb/branch/master/graph/badge.svg)](https://codecov.io/gh/mongodb/laravel-mongodb/branch/master) This package adds functionalities to the Eloquent model and Query builder for MongoDB, using the original Laravel API. *This library extends the original Laravel classes, so it uses exactly the same methods.* @@ -46,8 +45,6 @@ This package adds functionalities to the Eloquent model and Query builder for Mo - [Cross-Database Relationships](#cross-database-relationships) - [Authentication](#authentication) - [Queues](#queues) - - [Laravel specific](#laravel-specific) - - [Lumen specific](#lumen-specific) - [Upgrading](#upgrading) - [Upgrading from version 2 to 3](#upgrading-from-version-2-to-3) - [Security contact information](#security-contact-information) @@ -79,7 +76,7 @@ Make sure you have the MongoDB PHP driver installed. You can find installation i Install the package via Composer: ```bash -$ composer require jenssegers/mongodb +$ composer require mongodb/laravel-mongodb ``` ### Laravel @@ -87,7 +84,7 @@ $ composer require jenssegers/mongodb In case your Laravel version does NOT autoload the packages, add the service provider to `config/app.php`: ```php -Jenssegers\Mongodb\MongodbServiceProvider::class, +MongoDB\Laravel\MongodbServiceProvider::class, ``` ### Lumen @@ -95,7 +92,7 @@ Jenssegers\Mongodb\MongodbServiceProvider::class, For usage with [Lumen](http://lumen.laravel.com), add the service provider in `bootstrap/app.php`. In this file, you will also need to enable Eloquent. You must however ensure that your call to `$app->withEloquent();` is **below** where you have registered the `MongodbServiceProvider`: ```php -$app->register(Jenssegers\Mongodb\MongodbServiceProvider::class); +$app->register(MongoDB\Laravel\MongodbServiceProvider::class); $app->withEloquent(); ``` @@ -112,7 +109,7 @@ For usage outside Laravel, check out the [Capsule manager](https://github.com/il $capsule->getDatabaseManager()->extend('mongodb', function($config, $name) { $config['name'] = $name; - return new Jenssegers\Mongodb\Connection($config); + return new MongoDB\Laravel\Connection($config); }); ``` @@ -186,7 +183,7 @@ Eloquent This package includes a MongoDB enabled Eloquent class that you can use to define models for corresponding collections. ```php -use Jenssegers\Mongodb\Eloquent\Model; +use MongoDB\Laravel\Eloquent\Model; class Book extends Model { @@ -199,7 +196,7 @@ Just like a normal model, the MongoDB model class will know which collection to To change the collection, pass the `$collection` property: ```php -use Jenssegers\Mongodb\Eloquent\Model; +use MongoDB\Laravel\Eloquent\Model; class Book extends Model { @@ -210,7 +207,7 @@ class Book extends Model **NOTE:** MongoDB documents are automatically stored with a unique ID that is stored in the `_id` property. If you wish to use your own ID, substitute the `$primaryKey` property and set it to your own primary key attribute name. ```php -use Jenssegers\Mongodb\Eloquent\Model; +use MongoDB\Laravel\Eloquent\Model; class Book extends Model { @@ -224,7 +221,7 @@ Book::create(['id' => 1, 'title' => 'The Fault in Our Stars']); Likewise, you may define a `connection` property to override the name of the database connection that should be used when utilizing the model. ```php -use Jenssegers\Mongodb\Eloquent\Model; +use MongoDB\Laravel\Eloquent\Model; class Book extends Model { @@ -234,10 +231,10 @@ class Book extends Model ### Extending the Authenticatable base model -This package includes a MongoDB Authenticatable Eloquent class `Jenssegers\Mongodb\Auth\User` that you can use to replace the default Authenticatable class `Illuminate\Foundation\Auth\User` for your `User` model. +This package includes a MongoDB Authenticatable Eloquent class `MongoDB\Laravel\Auth\User` that you can use to replace the default Authenticatable class `Illuminate\Foundation\Auth\User` for your `User` model. ```php -use Jenssegers\Mongodb\Auth\User as Authenticatable; +use MongoDB\Laravel\Auth\User as Authenticatable; class User extends Authenticatable { @@ -249,10 +246,10 @@ class User extends Authenticatable When soft deleting a model, it is not actually removed from your database. Instead, a deleted_at timestamp is set on the record. -To enable soft deletes for a model, apply the `Jenssegers\Mongodb\Eloquent\SoftDeletes` Trait to the model: +To enable soft deletes for a model, apply the `MongoDB\Laravel\Eloquent\SoftDeletes` Trait to the model: ```php -use Jenssegers\Mongodb\Eloquent\SoftDeletes; +use MongoDB\Laravel\Eloquent\SoftDeletes; class User extends Model { @@ -274,7 +271,7 @@ Keep in mind guarding still works, but you may experience unexpected behavior. Eloquent allows you to work with Carbon or DateTime objects instead of MongoDate objects. Internally, these dates will be converted to MongoDate objects when saved to the database. ```php -use Jenssegers\Mongodb\Eloquent\Model; +use MongoDB\Laravel\Eloquent\Model; class User extends Model { @@ -812,7 +809,7 @@ The MongoDB-specific relationships are: Here is a small example: ```php -use Jenssegers\Mongodb\Eloquent\Model; +use MongoDB\Laravel\Eloquent\Model; class User extends Model { @@ -826,7 +823,7 @@ class User extends Model The inverse relation of `hasMany` is `belongsTo`: ```php -use Jenssegers\Mongodb\Eloquent\Model; +use MongoDB\Laravel\Eloquent\Model; class Item extends Model { @@ -844,7 +841,7 @@ The belongsToMany relation will not use a pivot "table" but will push id's to a If you want to define custom keys for your relation, set it to `null`: ```php -use Jenssegers\Mongodb\Eloquent\Model; +use MongoDB\Laravel\Eloquent\Model; class User extends Model { @@ -864,7 +861,7 @@ If you want to embed models, rather than referencing them, you can use the `embe **REMEMBER**: These relations return Eloquent collections, they don't return query builder objects! ```php -use Jenssegers\Mongodb\Eloquent\Model; +use MongoDB\Laravel\Eloquent\Model; class User extends Model { @@ -936,7 +933,7 @@ $user->save(); Like other relations, embedsMany assumes the local key of the relationship based on the model name. You can override the default local key by passing a second argument to the embedsMany method: ```php -use Jenssegers\Mongodb\Eloquent\Model; +use MongoDB\Laravel\Eloquent\Model; class User extends Model { @@ -954,7 +951,7 @@ Embedded relations will return a Collection of embedded items instead of a query The embedsOne relation is similar to the embedsMany relation, but only embeds a single model. ```php -use Jenssegers\Mongodb\Eloquent\Model; +use MongoDB\Laravel\Eloquent\Model; class Book extends Model { @@ -1156,14 +1153,14 @@ If you're using a hybrid MongoDB and SQL setup, you can define relationships acr The model will automatically return a MongoDB-related or SQL-related relation based on the type of the related model. -If you want this functionality to work both ways, your SQL-models will need to use the `Jenssegers\Mongodb\Eloquent\HybridRelations` trait. +If you want this functionality to work both ways, your SQL-models will need to use the `MongoDB\Laravel\Eloquent\HybridRelations` trait. **This functionality only works for `hasOne`, `hasMany` and `belongsTo`.** The MySQL model should use the `HybridRelations` trait: ```php -use Jenssegers\Mongodb\Eloquent\HybridRelations; +use MongoDB\Laravel\Eloquent\HybridRelations; class User extends Model { @@ -1181,7 +1178,7 @@ class User extends Model Within your MongoDB model, you should define the relationship: ```php -use Jenssegers\Mongodb\Eloquent\Model; +use MongoDB\Laravel\Eloquent\Model; class Message extends Model { @@ -1199,7 +1196,7 @@ class Message extends Model If you want to use Laravel's native Auth functionality, register this included service provider: ```php -Jenssegers\Mongodb\Auth\PasswordResetServiceProvider::class, +MongoDB\Laravel\Auth\PasswordResetServiceProvider::class, ``` This service provider will slightly modify the internal DatabaseReminderRepository to add support for MongoDB based password reminders. @@ -1234,63 +1231,19 @@ If you want to use MongoDB to handle failed jobs, change the database in `config ], ``` -#### Laravel specific - Add the service provider in `config/app.php`: ```php -Jenssegers\Mongodb\MongodbQueueServiceProvider::class, -``` - -#### Lumen specific - -With [Lumen](http://lumen.laravel.com), add the service provider in `bootstrap/app.php`. You must however ensure that you add the following **after** the `MongodbServiceProvider` registration. - -```php -$app->make('queue'); - -$app->register(Jenssegers\Mongodb\MongodbQueueServiceProvider::class); +MongoDB\Laravel\MongodbQueueServiceProvider::class, ``` Upgrading --------- -#### Upgrading from version 2 to 3 - -In this new major release which supports the new MongoDB PHP extension, we also moved the location of the Model class and replaced the MySQL model class with a trait. - -Please change all `Jenssegers\Mongodb\Model` references to `Jenssegers\Mongodb\Eloquent\Model` either at the top of your model files or your registered alias. - -```php -use Jenssegers\Mongodb\Eloquent\Model; - -class User extends Model -{ - // -} -``` +#### Upgrading from version 3 to 4 -If you are using hybrid relations, your MySQL classes should now extend the original Eloquent model class `Illuminate\Database\Eloquent\Model` instead of the removed `Jenssegers\Eloquent\Model`. - -Instead use the new `Jenssegers\Mongodb\Eloquent\HybridRelations` trait. This should make things more clear as there is only one single model class in this package. - -```php -use Jenssegers\Mongodb\Eloquent\HybridRelations; - -class User extends Model -{ - - use HybridRelations; - - protected $connection = 'mysql'; -} -``` - -Embedded relations now return an `Illuminate\Database\Eloquent\Collection` rather than a custom Collection class. If you were using one of the special methods that were available, convert them to Collection operations. - -```php -$books = $user->books()->sortBy('title')->get(); -``` +Change project name in composer.json to `mongodb/laravel` and run `composer update`. +Change namespace from `Jenssegers\Mongodb` to `MongoDB\Laravel` in your models and config. ## Security contact information diff --git a/composer.json b/composer.json index c628175f8..b5c2ddd8d 100644 --- a/composer.json +++ b/composer.json @@ -1,21 +1,24 @@ { - "name": "jenssegers/mongodb", - "description": "A MongoDB based Eloquent model and Query builder for Laravel (Moloquent)", + "name": "mongodb/laravel-mongodb", + "description": "A MongoDB based Eloquent model and Query builder for Laravel", "keywords": [ "laravel", "eloquent", "mongodb", "mongo", "database", - "model", - "moloquent" + "model" ], - "homepage": "https://github.com/jenssegers/laravel-mongodb", + "homepage": "https://github.com/mongodb/laravel-mongodb", + "support": { + "issues": "https://www.mongodb.com/support", + "security": "https://www.mongodb.com/security" + }, "authors": [ - { - "name": "Jens Segers", - "homepage": "https://jenssegers.com" - } + { "name": "Andreas Braun", "email": "andreas.braun@mongodb.com", "role": "Leader" }, + { "name": "Jérôme Tamarelle", "email": "jerome.tamarelle@mongodb.com", "role": "Maintainer" }, + { "name": "Jeremy Mikola", "email": "jmikola@gmail.com", "role": "Maintainer" }, + { "name": "Jens Segers", "homepage": "https://jenssegers.com", "role": "Creator" } ], "license": "MIT", "require": { @@ -32,25 +35,24 @@ "orchestra/testbench": "^8.0", "mockery/mockery": "^1.4.4" }, + "replace": { + "jenssegers/mongodb": "self.version" + }, "autoload": { "psr-4": { - "Jenssegers\\Mongodb\\": "src/" + "MongoDB\\Laravel\\": "src/" } }, "autoload-dev": { "psr-4": { - "Jenssegers\\Mongodb\\Tests\\": "tests/" + "MongoDB\\Laravel\\Tests\\": "tests/" } }, - "suggest": { - "jenssegers/mongodb-session": "Add MongoDB session support to Laravel-MongoDB", - "jenssegers/mongodb-sentry": "Add Sentry support to Laravel-MongoDB" - }, "extra": { "laravel": { "providers": [ - "Jenssegers\\Mongodb\\MongodbServiceProvider", - "Jenssegers\\Mongodb\\MongodbQueueServiceProvider" + "MongoDB\\Laravel\\MongodbServiceProvider", + "MongoDB\\Laravel\\MongodbQueueServiceProvider" ] } }, diff --git a/src/Auth/DatabaseTokenRepository.php b/src/Auth/DatabaseTokenRepository.php index 4574cf615..b2f43c748 100644 --- a/src/Auth/DatabaseTokenRepository.php +++ b/src/Auth/DatabaseTokenRepository.php @@ -1,6 +1,6 @@ [ \ArgumentCountError::class, - 'Too few arguments to function Jenssegers\Mongodb\Query\Builder::where("foo"), 1 passed and at least 2 expected when the 1st is a string', + 'Too few arguments to function MongoDB\Laravel\Query\Builder::where("foo"), 1 passed and at least 2 expected when the 1st is a string', fn (Builder $builder) => $builder->where('foo'), ]; diff --git a/tests/QueryBuilderTest.php b/tests/QueryBuilderTest.php index 11817018a..6c4e14f6e 100644 --- a/tests/QueryBuilderTest.php +++ b/tests/QueryBuilderTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Jenssegers\Mongodb\Tests; +namespace MongoDB\Laravel\Tests; use DateTime; use DateTimeImmutable; @@ -10,10 +10,6 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\LazyCollection; use Illuminate\Testing\Assert; -use Jenssegers\Mongodb\Collection; -use Jenssegers\Mongodb\Query\Builder; -use Jenssegers\Mongodb\Tests\Models\Item; -use Jenssegers\Mongodb\Tests\Models\User; use MongoDB\BSON\ObjectId; use MongoDB\BSON\Regex; use MongoDB\BSON\UTCDateTime; @@ -22,6 +18,10 @@ use MongoDB\Driver\Monitoring\CommandStartedEvent; use MongoDB\Driver\Monitoring\CommandSubscriber; use MongoDB\Driver\Monitoring\CommandSucceededEvent; +use MongoDB\Laravel\Collection; +use MongoDB\Laravel\Query\Builder; +use MongoDB\Laravel\Tests\Models\Item; +use MongoDB\Laravel\Tests\Models\User; class QueryBuilderTest extends TestCase { @@ -379,7 +379,7 @@ public function testPush() public function testPushRefuses2ndArgumentWhen1stIsAnArray() { $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('2nd argument of Jenssegers\Mongodb\Query\Builder::push() must be "null" when 1st argument is an array. Got "string" instead.'); + $this->expectExceptionMessage('2nd argument of MongoDB\Laravel\Query\Builder::push() must be "null" when 1st argument is an array. Got "string" instead.'); DB::collection('users')->push(['tags' => 'tag1'], 'tag2'); } diff --git a/tests/QueryTest.php b/tests/QueryTest.php index 8737a7d68..03713ffae 100644 --- a/tests/QueryTest.php +++ b/tests/QueryTest.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Jenssegers\Mongodb\Tests; +namespace MongoDB\Laravel\Tests; use DateTimeImmutable; -use Jenssegers\Mongodb\Tests\Models\Birthday; -use Jenssegers\Mongodb\Tests\Models\Scoped; -use Jenssegers\Mongodb\Tests\Models\User; +use MongoDB\Laravel\Tests\Models\Birthday; +use MongoDB\Laravel\Tests\Models\Scoped; +use MongoDB\Laravel\Tests\Models\User; class QueryTest extends TestCase { diff --git a/tests/QueueTest.php b/tests/QueueTest.php index 601d712ae..072835b32 100644 --- a/tests/QueueTest.php +++ b/tests/QueueTest.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace Jenssegers\Mongodb\Tests; +namespace MongoDB\Laravel\Tests; use Carbon\Carbon; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Queue; use Illuminate\Support\Str; -use Jenssegers\Mongodb\Queue\Failed\MongoFailedJobProvider; -use Jenssegers\Mongodb\Queue\MongoQueue; use Mockery; +use MongoDB\Laravel\Queue\Failed\MongoFailedJobProvider; +use MongoDB\Laravel\Queue\MongoQueue; class QueueTest extends TestCase { @@ -36,7 +36,7 @@ public function testQueueJobLifeCycle(): void // Get and reserve the test job (next available) $job = Queue::pop('test'); - $this->assertInstanceOf(\Jenssegers\Mongodb\Queue\MongoJob::class, $job); + $this->assertInstanceOf(\MongoDB\Laravel\Queue\MongoJob::class, $job); $this->assertEquals(1, $job->isReserved()); $this->assertEquals(json_encode([ 'uuid' => $uuid, diff --git a/tests/RelationsTest.php b/tests/RelationsTest.php index 66c27583f..f418bf384 100644 --- a/tests/RelationsTest.php +++ b/tests/RelationsTest.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Jenssegers\Mongodb\Tests; +namespace MongoDB\Laravel\Tests; use Illuminate\Database\Eloquent\Collection; -use Jenssegers\Mongodb\Tests\Models\Address; -use Jenssegers\Mongodb\Tests\Models\Book; -use Jenssegers\Mongodb\Tests\Models\Client; -use Jenssegers\Mongodb\Tests\Models\Group; -use Jenssegers\Mongodb\Tests\Models\Item; -use Jenssegers\Mongodb\Tests\Models\Photo; -use Jenssegers\Mongodb\Tests\Models\Role; -use Jenssegers\Mongodb\Tests\Models\User; use Mockery; +use MongoDB\Laravel\Tests\Models\Address; +use MongoDB\Laravel\Tests\Models\Book; +use MongoDB\Laravel\Tests\Models\Client; +use MongoDB\Laravel\Tests\Models\Group; +use MongoDB\Laravel\Tests\Models\Item; +use MongoDB\Laravel\Tests\Models\Photo; +use MongoDB\Laravel\Tests\Models\Role; +use MongoDB\Laravel\Tests\Models\User; class RelationsTest extends TestCase { diff --git a/tests/SchemaTest.php b/tests/SchemaTest.php index 4e820e58a..6befaa942 100644 --- a/tests/SchemaTest.php +++ b/tests/SchemaTest.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Jenssegers\Mongodb\Tests; +namespace MongoDB\Laravel\Tests; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -use Jenssegers\Mongodb\Schema\Blueprint; +use MongoDB\Laravel\Schema\Blueprint; class SchemaTest extends TestCase { diff --git a/tests/Seeder/DatabaseSeeder.php b/tests/Seeder/DatabaseSeeder.php index a5d7c940f..27e4468ad 100644 --- a/tests/Seeder/DatabaseSeeder.php +++ b/tests/Seeder/DatabaseSeeder.php @@ -1,6 +1,6 @@