Skip to content
This repository was archived by the owner on May 10, 2018. It is now read-only.

Commit 4f7bd72

Browse files
committed
Add first test that connects to a real Splunk server.
1 parent 14b0057 commit 4f7bd72

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33

44
# Generated documentation
55
docs/
6+
7+
# Local settings
8+
*.local.php

tests/ContextTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717

1818
require_once '../Splunk.php';
19+
require_once 'settings.php';
1920

2021
class ContextTest extends PHPUnit_Framework_TestCase
2122
{
@@ -73,4 +74,12 @@ public function testLoginFailDueToBadPassword()
7374
));
7475
$context->login();
7576
}
77+
78+
public function testLoginSuccessOnRealServer()
79+
{
80+
global $Splunk_testSettings;
81+
82+
$context = new Splunk_Context($Splunk_testSettings['connectArgs']);
83+
$context->login();
84+
}
7685
}

tests/settings.default.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
/*
4+
* Configuration for unit tests.
5+
*/
6+
7+
// Credentials to connect to a test instance of Splunk
8+
$Splunk_testSettings['connectArgs'] = array(
9+
//'host' => 'localhost',
10+
//'port' => 8089,
11+
//'username' => 'admin',
12+
'password' => 'changeme',
13+
);

tests/settings.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
3+
require 'settings.default.php';
4+
include 'settings.local.php'; // warn if file not found

0 commit comments

Comments
 (0)