Skip to content

Commit

Permalink
Less stringent tests
Browse files Browse the repository at this point in the history
  • Loading branch information
plessbd committed May 10, 2019
1 parent b0030c3 commit 38f39dc
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 4,293 deletions.
36 changes: 12 additions & 24 deletions tests/artifacts/xdmod/user_admin/input/get_dw_descripters-1.json
Original file line number Diff line number Diff line change
@@ -1,74 +1,62 @@
[
[
{
"username": "admin",
"output": "get_dw_descripters-admin-merged-1"
"username": "admin"
}
],
[
{
"username": "centerdirector",
"output": "get_dw_descripters-centerdirector-1"
"username": "centerdirector"
}
],
[
{
"username": "centerstaff",
"output": "get_dw_descripters-centerstaff-1"
"username": "centerstaff"
}
],
[
{
"username": "principal",
"output": "get_dw_descripters-principal-1"
"username": "principal"
}
],
[
{
"username": "normaluser",
"output": "get_dw_descripters-normaluser-1"
"username": "normaluser"
}
],
[
{
"username": "test.cd.one-center",
"output": "get_dw_descripters-test.cd.one-center-1"
"username": "test.cd.one-center"
}
],
[
{
"username": "test.cs.one-center",
"output": "get_dw_descripters-test.cs.one-center-1"
"username": "test.cs.one-center"
}
],
[
{
"username": "test.pi",
"output": "get_dw_descripters-test.pi-1"
"username": "test.pi"
}
],
[
{
"username": "test.normal-user",
"output": "get_dw_descripters-test.normal-user-1"
"username": "test.normal-user"
}
],
[
{
"username": "test.usr_dev",
"output": "get_dw_descripters-test.usr_dev-1"
"username": "test.usr_dev"
}
],
[
{
"username": "test.usr_mgr",
"output": "get_dw_descripters-test.usr_mgr-1"
"username": "test.usr_mgr"
}
],
[
{
"username": "test.usr_mgr_dev",
"output": "get_dw_descripters-test.usr_mgr_dev-1"
"username": "test.usr_mgr_dev"
}
]
]

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

36 changes: 27 additions & 9 deletions tests/integration/lib/Controllers/UserAdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,6 @@ public function provideGetTabs()
public function testGetDwDescripters(array $user)
{
$this->assertArrayHasKey('username', $user);
$this->assertArrayHasKey('output', $user);

$username = $user['username'];

$isPublicUser = $username === self::PUBLIC_USER_NAME;
Expand All @@ -427,13 +425,33 @@ public function testGetDwDescripters(array $user)
$this->assertArrayHasKey('data', $actual);
$this->assertArrayHasKey('totalCount', $actual);

$expectedFileName = $user['output'];
$expected = JSON::loadFile(
$this->getTestFiles()->getFile('user_admin', $expectedFileName, 'output')
);

$this->assertEquals($expected, $actual, "[$username] Get Data Warehouse Descripters - Expected:\n\n" . json_encode($expected) . "\n\nReceived:\n\n" . json_encode($actual));

$this->assertArrayHasKey(0, $actual['data']);
$this->assertArrayHasKey('realms', $actual['data'][0]);
$this->assertNotEmpty($actual['data'][0]['realms']);
foreach($actual['data'][0]['realms'] as $realm){
$this->assertArrayHasKey('metrics', $realm);
$this->assertNotEmpty($realm['metrics']);
$this->assertArrayHasKey('dimensions', $realm);
$this->assertNotEmpty($realm['dimensions']);
$this->assertArrayHasKey('text', $realm);
$this->assertNotEmpty($realm['text']);
$this->assertArrayHasKey('category', $realm);
$this->assertNotEmpty($realm['category']);
foreach($realm['metrics'] as $metric){
$this->assertArrayHasKey('text', $metric);
$this->assertNotEmpty($metric['text']);
$this->assertArrayHasKey('info', $metric);
$this->assertNotEmpty($metric['info']);
$this->assertArrayHasKey('std_err', $metric);
$this->assertInternalType('boolean', $metric['std_err']);
}
foreach($realm['dimensions'] as $dimension){
$this->assertArrayHasKey('text', $dimension);
$this->assertNotEmpty($dimension['text']);
$this->assertArrayHasKey('info', $dimension);
$this->assertNotEmpty($dimension['info']);
}
}
if (!$isPublicUser) {
$this->helper->logout();
}
Expand Down

0 comments on commit 38f39dc

Please sign in to comment.