Skip to content

Commit 9eabd73

Browse files
committed
<auto> merging hotfixes. re-added tests into repository.
1 parent 8b4c17a commit 9eabd73

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+6418
-0
lines changed

phpunit.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
// --------------------------------------------------------------
4+
// Define the directory separator for the environment.
5+
// --------------------------------------------------------------
6+
define('DS', DIRECTORY_SEPARATOR);
7+
8+
// --------------------------------------------------------------
9+
// Set the core Laravel path constants.
10+
// --------------------------------------------------------------
11+
require 'paths.php';
12+
13+
// --------------------------------------------------------------
14+
// Override the application paths when testing the core.
15+
// --------------------------------------------------------------
16+
$path = path('base').'tests'.DS;
17+
18+
set_path('app', $path.'application'.DS);
19+
20+
set_path('bundle', $path.'bundles'.DS);
21+
22+
set_path('storage', $path.'storage'.DS);
23+
24+
// --------------------------------------------------------------
25+
// Bootstrap the Laravel core.
26+
// --------------------------------------------------------------
27+
require path('sys').'core.php';
28+
29+
// --------------------------------------------------------------
30+
// Start the default bundle.
31+
// --------------------------------------------------------------
32+
Laravel\Bundle::start(DEFAULT_BUNDLE);

phpunit.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<phpunit colors="true"
2+
bootstrap="phpunit.php"
3+
backupGlobals="false">
4+
<testsuites>
5+
<testsuite name="Test Suite">
6+
<directory suffix=".test.php">tests/cases</directory>
7+
</testsuite>
8+
</testsuites>
9+
</phpunit>

tests/application/bundles.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
/*
4+
|--------------------------------------------------------------------------
5+
| Bundle Configuration
6+
|--------------------------------------------------------------------------
7+
|
8+
| Bundles allow you to conveniently extend and organize your application.
9+
| Think of bundles as self-contained applications. They can have routes,
10+
| controllers, models, views, configuration, etc. You can even create
11+
| your own bundles to share with the Laravel community.
12+
|
13+
| This is a list of the bundles installed for your application and tells
14+
| Laravel the location of the bundle's root directory, as well as the
15+
| root URI the bundle responds to.
16+
|
17+
| For example, if you have an "admin" bundle located in "bundles/admin"
18+
| that you want to handle requests with URIs that begin with "admin",
19+
| simply add it to the array like this:
20+
|
21+
| 'admin' => array(
22+
| 'location' => 'admin',
23+
| 'handles' => 'admin',
24+
| ),
25+
|
26+
| Note that the "location" is relative to the "bundles" directory.
27+
| Now the bundle will be recognized by Laravel and will be able
28+
| to respond to requests beginning with "admin"!
29+
|
30+
| Have a bundle that lives in the root of the bundle directory
31+
| and doesn't respond to any requests? Just add the bundle
32+
| name to the array and we'll take care of the rest.
33+
|
34+
*/
35+
36+
return array('dashboard' => array('handles' => 'dashboard'), 'dummy');
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
<?php
2+
3+
return array(
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Application URL
8+
|--------------------------------------------------------------------------
9+
|
10+
| The URL used to access your application without a trailing slash. The URL
11+
| does nto have to be set. If it isn't we'll try our best to guess the URL
12+
| of your application.
13+
|
14+
*/
15+
16+
'url' => '',
17+
18+
/*
19+
|--------------------------------------------------------------------------
20+
| Application Index
21+
|--------------------------------------------------------------------------
22+
|
23+
| If you are including the "index.php" in your URLs, you can ignore this.
24+
|
25+
| However, if you are using mod_rewrite to get cleaner URLs, just set
26+
| this option to an empty string and we'll take care of the rest.
27+
|
28+
*/
29+
30+
'index' => 'index.php',
31+
32+
/*
33+
|--------------------------------------------------------------------------
34+
| Application Key
35+
|--------------------------------------------------------------------------
36+
|
37+
| This key is used by the encryption and cookie classes to generate secure
38+
| encrypted strings and hashes. It is extremely important that this key
39+
| remain secret and should not be shared with anyone. Make it about 32
40+
| characters of random gibberish.
41+
|
42+
*/
43+
44+
'key' => '',
45+
46+
/*
47+
|--------------------------------------------------------------------------
48+
| Application Character Encoding
49+
|--------------------------------------------------------------------------
50+
|
51+
| The default character encoding used by your application. This encoding
52+
| will be used by the Str, Text, Form, and any other classes that need
53+
| to know what type of encoding to use for your awesome application.
54+
|
55+
*/
56+
57+
'encoding' => 'UTF-8',
58+
59+
/*
60+
|--------------------------------------------------------------------------
61+
| Application Language
62+
|--------------------------------------------------------------------------
63+
|
64+
| The default language of your application. This language will be used by
65+
| Lang library as the default language when doing string localization.
66+
|
67+
*/
68+
69+
'language' => 'en',
70+
71+
/*
72+
|--------------------------------------------------------------------------
73+
| SSL Link Generation
74+
|--------------------------------------------------------------------------
75+
|
76+
| Many sites use SSL to protect their users data. However, you may not
77+
| always be able to use SSL on your development machine, meaning all HTTPS
78+
| will be broken during development.
79+
|
80+
| For this reason, you may wish to disable the generation of HTTPS links
81+
| throughout your application. This option does just that. All attempts to
82+
| generate HTTPS links will generate regular HTTP links instead.
83+
|
84+
*/
85+
86+
'ssl' => true,
87+
88+
/*
89+
|--------------------------------------------------------------------------
90+
| Application Timezone
91+
|--------------------------------------------------------------------------
92+
|
93+
| The default timezone of your application. This timezone will be used when
94+
| Laravel needs a date, such as when writing to a log file or travelling
95+
| to a distant star at warp speed.
96+
|
97+
*/
98+
99+
'timezone' => 'UTC',
100+
101+
/*
102+
|--------------------------------------------------------------------------
103+
| Class Aliases
104+
|--------------------------------------------------------------------------
105+
|
106+
| Here, you can specify any class aliases that you would like registered
107+
| when Laravel loads. Aliases are lazy-loaded, so add as many as you want.
108+
|
109+
| Aliases make it more convenient to use namespaced classes. Instead of
110+
| referring to the class using its full namespace, you may simply use
111+
| the alias defined here.
112+
|
113+
| We have already aliased common Laravel classes to make your life easier.
114+
|
115+
*/
116+
117+
'aliases' => array(
118+
'Auth' => 'Laravel\\Auth',
119+
'Asset' => 'Laravel\\Asset',
120+
'Autoloader' => 'Laravel\\Autoloader',
121+
'Blade' => 'Laravel\\Blade',
122+
'Bundle' => 'Laravel\\Bundle',
123+
'Cache' => 'Laravel\\Cache',
124+
'Config' => 'Laravel\\Config',
125+
'Controller' => 'Laravel\\Routing\\Controller',
126+
'Cookie' => 'Laravel\\Cookie',
127+
'Crypter' => 'Laravel\\Crypter',
128+
'DB' => 'Laravel\\Database',
129+
'Event' => 'Laravel\\Event',
130+
'File' => 'Laravel\\File',
131+
'Filter' => 'Laravel\\Routing\\Filter',
132+
'Form' => 'Laravel\\Form',
133+
'Hash' => 'Laravel\\Hash',
134+
'HTML' => 'Laravel\\HTML',
135+
'Input' => 'Laravel\\Input',
136+
'IoC' => 'Laravel\\IoC',
137+
'Lang' => 'Laravel\\Lang',
138+
'Log' => 'Laravel\\Log',
139+
'Memcached' => 'Laravel\\Memcached',
140+
'Paginator' => 'Laravel\\Paginator',
141+
'URL' => 'Laravel\\URL',
142+
'Redirect' => 'Laravel\\Redirect',
143+
'Redis' => 'Laravel\\Redis',
144+
'Request' => 'Laravel\\Request',
145+
'Response' => 'Laravel\\Response',
146+
'Route' => 'Laravel\\Routing\\Route',
147+
'Router' => 'Laravel\\Routing\\Router',
148+
'Schema' => 'Laravel\\Database\\Schema',
149+
'Section' => 'Laravel\\Section',
150+
'Session' => 'Laravel\\Session',
151+
'Str' => 'Laravel\\Str',
152+
'Task' => 'Laravel\\CLI\\Tasks\\Task',
153+
'URI' => 'Laravel\\URI',
154+
'Validator' => 'Laravel\\Validator',
155+
'View' => 'Laravel\\View',
156+
),
157+
158+
);

tests/application/config/auth.php

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?php
2+
3+
return array(
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Retrieve The Current User
8+
|--------------------------------------------------------------------------
9+
|
10+
| This closure is called by the Auth class' "user" method when trying to
11+
| retrieve a user by the ID that is stored in their session. If you find
12+
| the user, just return the user object, but make sure it has an "id"
13+
| property. If you can't find the user, just return null.
14+
|
15+
| Of course, a simple and elegant authentication solution has already
16+
| been provided for you using the query builder and hashing engine.
17+
| We love making your life as easy as possible.
18+
|
19+
*/
20+
21+
'user' => function($id)
22+
{
23+
if (filter_var($id, FILTER_VALIDATE_INT) !== false)
24+
{
25+
return DB::table('users')->find($id);
26+
}
27+
},
28+
29+
/*
30+
|--------------------------------------------------------------------------
31+
| Authenticate User Credentials
32+
|--------------------------------------------------------------------------
33+
|
34+
| This closure is called by the Auth::attempt() method when attempting to
35+
| authenticate a user that is logging into your application. It's like a
36+
| super buff bouncer to your application.
37+
|
38+
| If the provided credentials are correct, simply return an object that
39+
| represents the user being authenticated. As long as it has a property
40+
| for the "id", any object will work. If the credentials are not valid,
41+
| you don't meed to return anything.
42+
|
43+
*/
44+
45+
'attempt' => function($username, $password)
46+
{
47+
$user = DB::table('users')->where_username($username)->first();
48+
49+
if ( ! is_null($user) and Hash::check($password, $user->password))
50+
{
51+
return $user;
52+
}
53+
},
54+
55+
/*
56+
|--------------------------------------------------------------------------
57+
| Logout The Current User
58+
|--------------------------------------------------------------------------
59+
|
60+
| Here you may do anything that needs to be done when a user logs out of
61+
| your application, such as call the logout method on a third-party API
62+
| you are using for authentication or anything else you desire.
63+
|
64+
*/
65+
66+
'logout' => function($user) {},
67+
68+
/*
69+
|--------------------------------------------------------------------------
70+
| "Remember Me" Cookie Name
71+
|--------------------------------------------------------------------------
72+
|
73+
| Here you may specify the cookie name that will be used for the cookie
74+
| that serves as the "remember me" token. Of course, a sensible default
75+
| has been set for you, so you probably don't need to change it.
76+
|
77+
*/
78+
79+
'cookie' => 'laravel_remember',
80+
81+
);

tests/application/config/cache.php

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?php
2+
3+
return array(
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Cache Driver
8+
|--------------------------------------------------------------------------
9+
|
10+
| The name of the default cache driver for your application. Caching can
11+
| be used to increase the performance of your application by storing any
12+
| commonly accessed data in memory, a file, or some other storage.
13+
|
14+
| A variety of awesome drivers are available for you to use with Laravel.
15+
| Some, like APC, are extremely fast. However, if that isn't an option
16+
| in your environment, try file or database caching.
17+
|
18+
| Drivers: 'file', 'memcached', 'apc', 'redis', 'database'.
19+
|
20+
*/
21+
22+
'driver' => 'file',
23+
24+
/*
25+
|--------------------------------------------------------------------------
26+
| Cache Key
27+
|--------------------------------------------------------------------------
28+
|
29+
| This key will be prepended to item keys stored using Memcached and APC
30+
| to prevent collisions with other applications on the server. Since the
31+
| memory based stores could be shared by other applications, we need to
32+
| be polite and use a prefix to uniquely identifier our items.
33+
|
34+
*/
35+
36+
'key' => 'laravel',
37+
38+
/*
39+
|--------------------------------------------------------------------------
40+
| Cache Database
41+
|--------------------------------------------------------------------------
42+
|
43+
| When using the database cache driver, this database table will be used
44+
| to store the cached item. You may also add a "connection" option to
45+
| the array to specify which database connection should be used.
46+
|
47+
*/
48+
49+
'database' => array('table' => 'laravel_cache'),
50+
51+
/*
52+
|--------------------------------------------------------------------------
53+
| Memcached Servers
54+
|--------------------------------------------------------------------------
55+
|
56+
| The Memcached servers used by your application. Memcached is a free and
57+
| open source, high-performance, distributed memory caching system. It is
58+
| generic in nature but intended for use in speeding up web applications
59+
| by alleviating database load.
60+
|
61+
| For more information, check out: http://memcached.org
62+
|
63+
*/
64+
65+
'memcached' => array(
66+
67+
array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100),
68+
69+
),
70+
71+
);

0 commit comments

Comments
 (0)