Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
383 changes: 214 additions & 169 deletions .idea/workspace.xml

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,29 @@ brnaches:
only:
- master
before_script:
- mysql -e 'create database test;'
- mysql -e 'create database citest;'
- cp app/config/testing/database.ci.php app/config/testing/database.php #copy over CI environment configuration | database conv
- cp app/config/database.ci.php app/config/database.php #copy over CI environment configuration | database conv
- travis_retry composer self-update
- travis_retry composer install --prefer-source --no-interaction --dev
- chmod -R 777 app/storage/
- yes | php artisan migrate
- yes | php artisan db:seed
- php artisan migrate --env=testing --no-interaction -vvv
- php artisan db:seed --env=testing --no-interaction -vvv
- php -S localhost:8000 -t public &
- sleep 5 # give artisan serve some time to start
- vendor/bin/codecept build
- cp tests/acceptance.suite.yml.ci tests/acceptance.suite.yml #copy over CI acceptance test configuration
# should I do this to all other suites ?

script:
- php vendor/bin/codecept run --report --coverage-xml
- php vendor/bin/codecept run --coverage-xml


after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover tests/_output/coverage.xml

after_failure:
- cat app/storage/logs/laravel.log
- cat tests/_output/*
- cat tests/_output/*

126 changes: 126 additions & 0 deletions app/config/database.ci.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<?php

return array(

/*
|--------------------------------------------------------------------------
| PDO Fetch Style
|--------------------------------------------------------------------------
|
| By default, database results will be returned as instances of the PHP
| stdClass object; however, you may desire to retrieve records in an
| array format for simplicity. Here you can tweak the fetch style.
|
*/

'fetch' => PDO::FETCH_CLASS,

/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/

'default' => 'mysql',

/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/

'connections' => array(

'sqlite' => array(
'driver' => 'sqlite',
'database' => __DIR__.'/../database/production.sqlite',
'prefix' => '',
),

'mysql' => array(
'driver' => 'mysql',
'host' => '127.0.0.1',
'database' => 'citest',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',

),


'pgsql' => array(
'driver' => 'pgsql',
'host' => 'localhost',
'database' => 'SE3800',
'username' => 'postgres',
'password' => 'SeniorDesign15',
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
),

'sqlsrv' => array(
'driver' => 'sqlsrv',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => '',
'prefix' => '',
),

),

/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/

'migrations' => 'migrations',

/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/

'redis' => array(

'cluster' => false,

'default' => array(
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0,
),

),

);
102 changes: 49 additions & 53 deletions app/config/testing/database.ci.php
Original file line number Diff line number Diff line change
@@ -1,54 +1,50 @@


<?php
/**
* Created by PhpStorm.
* User: almatrudia
* Date: 1/28/2015
* Time: 3:18 PM
*/

return array(

/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
I had to add the port number in there: I got access dened
*/

'connections' => array(

'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'test',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),

'pgsql' => array(
'driver' => 'pgsql',
'host' => 'localhost',
'database' => 'homestead',
'username' => 'homestead',
'password' => 'secret',
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
),

),

);

return array(

/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
I had to add the port number in there: I got access dened
*/

'connections' => array(

'mysql' => array(
'driver' => 'mysql',
'host' => '127.0.0.1',
'database' => 'citest',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),

'pgsql' => array(
'driver' => 'pgsql',
'host' => 'localhost',
'database' => 'homestead',
'username' => 'homestead',
'password' => 'secret',
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
),

),

);
31 changes: 28 additions & 3 deletions app/controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,42 @@ public function showWelcome()
{
return View::make('hello');
}
public function showRegistrar()
{
return View::make('/registrar');
}

public function register(){


$validator = User::getValidator(Input::all());


if($validator->fails()){
return Redirect::to('registrar')->withErrors($validator)
->withInput(Input::except('password','password_confirm'));

}else{

$user = new User;
$user->first_name = Input::get('first_name');
$user->last_name = Input::get('last_name');
$user->username = Input::get('username');
$user->email = Input::get('email');
$user->password = Hash::make(Input::get('password'));

$user->save();
return View::make('conformation');
}

}
public function login() {
// setup the reules
$rules = array(
'username' => 'required',
'username'=> 'required',
'password' => 'required',
);


$validator = Validator::make(Input::all(),$rules);

if($validator->fails()){// case failure
Expand All @@ -44,7 +70,6 @@ public function login() {
'password' => Input::get('password')
);

// dd(DB::connection('pgsql'));

if (Auth::attempt($userdata)) {
return View::make('mainPage');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ public function up()
$table->string('last_name');
$table->string('username');
$table->string('password');
$table->string('email')->unique;});
}
$table->string('email')->unique;
$table->string('remember_token',100);});

}
/**
* Reverse the migrations.
*
Expand Down
1 change: 0 additions & 1 deletion app/database/seeds/UserTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public function run()
'last_name' => 'Almatrudi',
'email' => 'almatrudia@msoe.edu',
'password' => Hash::make('password')

));

}
Expand Down
1 change: 1 addition & 0 deletions app/lang/en/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,5 @@

'attributes' => array(),


);
Loading