Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-mongodb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
laravel-mongodb
Commits
d7ac7b07
Commit
d7ac7b07
authored
Mar 19, 2014
by
Jens Segers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding some extra tests
parent
249a6ce5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
ConnectionTest.php
tests/ConnectionTest.php
+6
-0
SchemaTest.php
tests/SchemaTest.php
+16
-0
No files found.
tests/ConnectionTest.php
View file @
d7ac7b07
...
@@ -81,4 +81,10 @@ class ConnectionTest extends PHPUnit_Framework_TestCase {
...
@@ -81,4 +81,10 @@ class ConnectionTest extends PHPUnit_Framework_TestCase {
$this
->
assertEquals
(
5
,
count
(
DB
::
getQueryLog
()));
$this
->
assertEquals
(
5
,
count
(
DB
::
getQueryLog
()));
}
}
public
function
testSchemaBuilder
()
{
$schema
=
DB
::
connection
(
'mongodb'
)
->
getSchemaBuilder
();
$this
->
assertInstanceOf
(
'Jenssegers\Mongodb\Schema\Builder'
,
$schema
);
}
}
}
tests/SchemaTest.php
View file @
d7ac7b07
...
@@ -16,6 +16,7 @@ class SchemaTest extends PHPUnit_Framework_TestCase {
...
@@ -16,6 +16,7 @@ class SchemaTest extends PHPUnit_Framework_TestCase {
{
{
Schema
::
create
(
'newcollection'
);
Schema
::
create
(
'newcollection'
);
$this
->
assertTrue
(
Schema
::
hasCollection
(
'newcollection'
));
$this
->
assertTrue
(
Schema
::
hasCollection
(
'newcollection'
));
$this
->
assertTrue
(
Schema
::
hasTable
(
'newcollection'
));
}
}
public
function
testDrop
()
public
function
testDrop
()
...
@@ -25,6 +26,21 @@ class SchemaTest extends PHPUnit_Framework_TestCase {
...
@@ -25,6 +26,21 @@ class SchemaTest extends PHPUnit_Framework_TestCase {
$this
->
assertFalse
(
Schema
::
hasCollection
(
'newcollection'
));
$this
->
assertFalse
(
Schema
::
hasCollection
(
'newcollection'
));
}
}
public
function
testBluePrint
()
{
$instance
=
$this
;
Schema
::
collection
(
'newcollection'
,
function
(
$collection
)
use
(
$instance
)
{
$instance
->
assertInstanceOf
(
'Jenssegers\Mongodb\Schema\Blueprint'
,
$collection
);
});
Schema
::
table
(
'newcollection'
,
function
(
$collection
)
use
(
$instance
)
{
$instance
->
assertInstanceOf
(
'Jenssegers\Mongodb\Schema\Blueprint'
,
$collection
);
});
}
public
function
testIndex
()
public
function
testIndex
()
{
{
Schema
::
collection
(
'newcollection'
,
function
(
$collection
)
Schema
::
collection
(
'newcollection'
,
function
(
$collection
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment