Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
breyta
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thomas Flori
breyta
Commits
fc653edd
Unverified
Commit
fc653edd
authored
6 years ago
by
Thomas Flori
Browse files
Options
Downloads
Patches
Plain Diff
prepare migrate test
parent
1833dcf2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/Migrations/MigrateTest.php
+34
-3
34 additions, 3 deletions
tests/Migrations/MigrateTest.php
with
34 additions
and
3 deletions
tests/Migrations/MigrateTest.php
+
34
−
3
View file @
fc653edd
...
@@ -3,16 +3,47 @@
...
@@ -3,16 +3,47 @@
namespace
Breyta\Test\Migrations
;
namespace
Breyta\Test\Migrations
;
use
Breyta\Migrations
;
use
Breyta\Migrations
;
use
Breyta\Model\Migration
;
use
Breyta\Test\TestCase
;
use
Breyta\Test\TestCase
;
use
Mockery
as
m
;
class
MigrateTest
extends
TestCase
class
MigrateTest
extends
TestCase
{
{
/** @var m\Mock|\PDOStatement */
protected
$statement
;
/** @var m\Mock|Migrations */
protected
$migrations
;
/** @var m\Mock */
protected
$resolver
;
protected
function
setUp
()
{
parent
::
setUp
();
$resolver
=
$this
->
resolver
=
m
::
spy
(
function
(
$class
,
...
$args
)
{
return
new
$class
(
...
$args
);
});
$migrations
=
$this
->
migrations
=
m
::
mock
(
Migrations
::
class
,
[
$this
->
pdo
,
__DIR__
.
'/../Example'
,
$resolver
])
->
makePartial
();
$migrations
->
shouldReceive
(
'getStatus'
)
->
with
()
->
andReturn
((
object
)[
'migrations'
=>
[
Migration
::
createInstance
([
'file'
=>
'@breyta/CreateMigrationTable.php'
,
'status'
=>
'done'
]),
],
'count'
=>
0
,
])
->
byDefault
();
}
/** @test */
/** @test */
public
function
returnsSuccessAsBoolean
()
public
function
returnsSuccessAsBoolean
()
{
{
$migrations
=
new
Migrations
(
$this
->
pdo
,
__DIR__
.
'/../Example'
);
$result
=
$this
->
migrations
->
migrate
();
$result
=
$migrations
->
migrate
();
self
::
assertTrue
(
$result
);
self
::
assertTrue
(
$result
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment