Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
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
Yeray Santana Hualde
syncEnrollments
Commits
bf509b67
Commit
bf509b67
authored
Jan 24, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added config class tests.
parent
18b6cc44
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
1 deletion
+79
-1
config.test.php
tests/cases/laravel/config.test.php
+65
-0
.gitignore
tests/laravel/application/config/.gitignore
+0
-1
database.php
tests/laravel/application/config/local/database.php
+7
-0
meta.php
tests/laravel/bundles/dashboard/config/meta.php
+7
-0
No files found.
tests/cases/laravel/config.test.php
0 → 100644
View file @
bf509b67
<?php
class
ConfigTest
extends
PHPUnit_Framework_TestCase
{
/**
* Tear down the testing environment.
*/
public
function
tearDown
()
{
Config
::
$items
=
array
();
Config
::
$cache
=
array
();
}
/**
* Test the Config::get method.
*
* @group laravel
*/
public
function
testItemsCanBeRetrievedFromConfigFiles
()
{
$this
->
assertEquals
(
'UTF-8'
,
Config
::
get
(
'application.encoding'
));
$this
->
assertEquals
(
'mysql'
,
Config
::
get
(
'database.connections.mysql.driver'
));
$this
->
assertEquals
(
'dashboard'
,
Config
::
get
(
'dashboard::meta.bundle'
));
}
/**
* Test the Config::has method.
*
* @group laravel
*/
public
function
testHasMethodIndicatesIfConfigItemExists
()
{
$this
->
assertFalse
(
Config
::
has
(
'application.foo'
));
$this
->
assertTrue
(
Config
::
has
(
'application.encoding'
));
}
/**
* Test the Config::set method.
*
* @group laravel
*/
public
function
testConfigItemsCanBeSet
()
{
Config
::
set
(
'application.encoding'
,
'foo'
);
Config
::
set
(
'dashboard::meta.bundle'
,
'bar'
);
$this
->
assertEquals
(
'foo'
,
Config
::
get
(
'application.encoding'
));
$this
->
assertEquals
(
'bar'
,
Config
::
get
(
'dashboard::meta.bundle'
));
}
/**
* Test that environment configurations are loaded correctly.
*
* @group laravel
*/
public
function
testEnvironmentConfigsOverrideNormalConfigurations
()
{
$_SERVER
[
'LARAVEL_ENV'
]
=
'local'
;
$this
->
assertEquals
(
'sqlite'
,
Config
::
get
(
'database.default'
));
unset
(
$_SERVER
[
'LARAVEL_ENV'
]);
}
}
\ No newline at end of file
tests/laravel/application/config/.gitignore
deleted
100644 → 0
View file @
18b6cc44
local/*
\ No newline at end of file
tests/laravel/application/config/local/database.php
0 → 100644
View file @
bf509b67
<?php
return
array
(
'default'
=>
'sqlite'
,
);
\ No newline at end of file
tests/laravel/bundles/dashboard/config/meta.php
0 → 100644
View file @
bf509b67
<?php
return
array
(
'bundle'
=>
'dashboard'
,
);
\ No newline at end of file
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