Skip to content

Commit f6212ab

Browse files
committed
Merges with develop.
2 parents 2716682 + 9ddb913 commit f6212ab

File tree

6 files changed

+46
-7
lines changed

6 files changed

+46
-7
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ before_script:
1717
- php artisan migrate --env="testing"
1818

1919
script: ./vendor/bin/phpunit
20+
after_success: sh test.sh
2021

2122
notifications:
2223
slack:

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.5.3
1+
1.6.0

app/config/local/app.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
'Jenssegers\Mongodb\Auth\ReminderServiceProvider',
66
)),
77

8-
'debug' => false,
8+
'debug' => true,
99
);

app/locker/data/dashboards/AdminDashboard.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,12 @@ public function lrsCount(){
5858
*
5959
**/
6060
public function actorCount(){
61-
6261
$mbox = intval( \Statement::distinct('statement.actor.mbox')->remember(5)->count() );
6362
$openid = intval( \Statement::distinct('statement.actor.openid')->remember(5)->count() );
6463
$mbox_sha1sum = intval( \Statement::distinct('statement.actor.mbox_sha1sum')->remember(5)->count() );
6564
$account = intval( \Statement::distinct('statement.actor.account.name')->remember(5)->count() );
66-
return ($mbox + $openid + $mbox_sha1sum + $account);
67-
}
65+
return ($mbox + $openid + $mbox_sha1sum + $account);
66+
}
6867

6968
/**
7069
* Count the number of users in Learning Locker.

app/locker/repository/Query/EloquentQueryRepository.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,14 @@ public function aggregate(array $opts, array $pipeline) {
8484
];
8585

8686
$cache_key = sha1(json_encode($pipeline));
87-
$result = IlluminateCache::get($cache_key, function() use ($pipeline, $cache_key) {
87+
$create_cache = function () use ($pipeline, $cache_key) {
8888
$expiration = Carbon::now()->addMinutes(10);
8989
$result = Helpers::replaceHtmlEntity($this->db->statements->aggregate($pipeline), true);
9090
IlluminateCache::put($cache_key, $result, $expiration);
9191
return $result;
92-
});
92+
};
93+
//$result = IlluminateCache::get($cache_key, $create_cache);
94+
$result = $create_cache();
9395

9496
return $result;
9597
}

test.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env sh
2+
3+
DEVELOP="develop"
4+
5+
if [ "${DEVELOP}" = "${TRAVIS_BRANCH}" ]; then
6+
echo "Running conformance tests."
7+
8+
# Starts the server.
9+
sudo chmod -R 777 *
10+
php artisan serve --env=testing --host 0.0.0.0 --port=8000 &
11+
12+
# Creates a new User.
13+
mongo ll_staging --eval 'db.users.insert({"name" : "Test User", "email" : "[email protected]", "verified" : "yes", "role" : "super", "password" : "$2y$10$MKDC2thihULF3fNuVj.DyORidVd.airmxZicEcSrpNQRsJMX3ZGBW"})'
14+
15+
# Creates a new LRS.
16+
mongo ll_staging --eval 'db.lrs.insert({"title" : "Conformance", "description" : "", "owner" : { "_id" : db.users.find()[0]._id}})'
17+
18+
# Creates a new Client.
19+
mongo ll_staging --eval 'db.client.insert({"api" : { "basic_key" : "1484c2ac05269b8c5479a1dd6a0d6370991fd6a1", "basic_secret" : "f0ef3d8062805c0fc1675beb8ac0715c75df13cb" }, "lrs_id" : db.lrs.find()[0]._id, "authority" : { "name" : "New Client", "mbox" : "mailto:[email protected]" }, "scopes" : [ "all" ]})'
20+
21+
# Runs the test suite.
22+
git clone https://github.com/ryansmith94/xAPI_LRS_Test.git conformance > /dev/null
23+
cd conformance
24+
git checkout travis > /dev/null
25+
cd src
26+
npm install -g grunt-cli > /dev/null
27+
npm install > /dev/null
28+
grunt --bail --reporter=dot --endpoint="http://0.0.0.0:8000/data/xAPI/" --username="1484c2ac05269b8c5479a1dd6a0d6370991fd6a1" --password="f0ef3d8062805c0fc1675beb8ac0715c75df13cb" --xapi-version="1.0.1"
29+
30+
# Stops the server.
31+
ps aux | grep [p]hp | awk '{print $2}' | xargs kill
32+
echo "Stopped the server."
33+
34+
echo "Completed conformance tests."
35+
else
36+
echo "Not running conformance tests."
37+
fi

0 commit comments

Comments
 (0)