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
319964fc
Commit
319964fc
authored
Jan 18, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added basic autoloader tests.
parent
9de8e005
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
87 additions
and
2 deletions
+87
-2
auth.php
laravel/auth.php
+1
-1
phpunit.php
phpunit.php
+6
-1
autoloader.test.php
tests/cases/laravel/autoloader.test.php
+74
-0
user.php
tests/laravel/models/repositories/user.php
+3
-0
user.php
tests/laravel/models/user.php
+3
-0
No files found.
laravel/auth.php
View file @
319964fc
...
...
@@ -190,7 +190,7 @@ class Auth {
// This method assumes the "remember me" cookie should have the same
// configuration as the session cookie. Since this cookie, like the
// session cookie, should be kept very secure, it's probably safe
// session cookie, should be kept very secure, it's probably safe
.
// to assume the cookie settings are the same.
$config
=
Config
::
get
(
'session'
);
...
...
phpunit.php
View file @
319964fc
...
...
@@ -27,4 +27,9 @@ require 'paths.php';
// --------------------------------------------------------------
// Bootstrap the Laravel core.
// --------------------------------------------------------------
require
SYS_PATH
.
'core.php'
;
\ No newline at end of file
require
SYS_PATH
.
'core.php'
;
// --------------------------------------------------------------
// Start the default bundle.
// --------------------------------------------------------------
Bundle
::
start
(
DEFAULT_BUNDLE
);
\ No newline at end of file
tests/cases/laravel/autoloader.test.php
0 → 100644
View file @
319964fc
<?php
class
AutoloaderTest
extends
PHPUnit_Framework_TestCase
{
/**
* Test the Autoloader::map method.
*
* @group laravel
*/
public
function
testMapsCanBeRegistered
()
{
Autoloader
::
map
(
array
(
'Foo'
=>
APP_PATH
.
'models/foo.php'
,
));
$this
->
assertEquals
(
APP_PATH
.
'models/foo.php'
,
Autoloader
::
$mappings
[
'Foo'
]);
}
/**
* Test the Autoloader::alias method.
*
* @group laravel
*/
public
function
testAliasesCanBeRegistered
()
{
Autoloader
::
alias
(
'Foo\\Bar'
,
'Foo'
);
$this
->
assertEquals
(
'Foo\\Bar'
,
Autoloader
::
$aliases
[
'Foo'
]);
}
/**
* Test the Autoloader::psr method.
*
* @group laravel
*/
public
function
testPsrDirectoriesCanBeRegistered
()
{
Autoloader
::
psr
(
array
(
APP_PATH
.
'foo'
.
DS
.
'bar'
,
APP_PATH
.
'foo'
.
DS
.
'baz'
.
DS
.
DS
,
));
$this
->
assertTrue
(
in_array
(
APP_PATH
.
'foo'
.
DS
.
'bar'
.
DS
,
Autoloader
::
$psr
));
$this
->
assertTrue
(
in_array
(
APP_PATH
.
'foo'
.
DS
.
'baz'
.
DS
,
Autoloader
::
$psr
));
}
/**
* Test the Autoloader::namespaces method.
*
* @group laravel
*/
public
function
testNamespacesCanBeRegistered
()
{
Autoloader
::
namespaces
(
array
(
'Autoloader_1'
=>
BUNDLE_PATH
.
'autoload'
.
DS
.
'models'
,
'Autoloader_2'
=>
BUNDLE_PATH
.
'autoload'
.
DS
.
'libraries'
.
DS
.
DS
,
));
$this
->
assertEquals
(
BUNDLE_PATH
.
'autoload'
.
DS
.
'models'
.
DS
,
Autoloader
::
$namespaces
[
'Autoloader_1'
]);
$this
->
assertEquals
(
BUNDLE_PATH
.
'autoload'
.
DS
.
'libraries'
.
DS
,
Autoloader
::
$namespaces
[
'Autoloader_2'
]);
}
/**
* Test the loading of PSR-0 models and libraries.
*
* @group laravel
*/
public
function
testPsrLibrariesAndModelsCanBeLoaded
()
{
$this
->
assertInstanceOf
(
'User'
,
new
User
);
$this
->
assertInstanceOf
(
'Repositories\\User'
,
new
Repositories\User
);
}
}
\ No newline at end of file
tests/laravel/models/repositories/user.php
0 → 100644
View file @
319964fc
<?php
namespace
Repositories
;
class
User
{}
\ No newline at end of file
tests/laravel/models/user.php
0 → 100644
View file @
319964fc
<?php
class
User
{}
\ 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