Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Get tests running.

  • Loading branch information...
commit 219a3c1a2635f5972d09d109953cae67fe59dc74 1 parent d0706c4
@lucor lucor authored
Showing with 88 additions and 0 deletions.
  1. +34 −0 tests/AllTests.php
  2. +54 −0 tests/test_config.inc.php
View
34 tests/AllTests.php
@@ -0,0 +1,34 @@
+<?php
+
+// Keep tests from running twice when calling this file directly via PHPUnit.
+$call_main = false;
+if (strpos($_SERVER['argv'][0], 'phpunit') === false) {
+ // Called via php, not PHPUnit. Pass the request to PHPUnit.
+ if (!defined('PHPUnit_MAIN_METHOD')) {
+ /** The test's main method name */
+ define('PHPUnit_MAIN_METHOD', 'Services_Atlassian_Crowd_AllTests::main');
+ $call_main = true;
+ }
+}
+
+require_once dirname(__FILE__) . '/test_config.php';
+
+class Services_Atlassian_Crowd_AllTests
+{
+ public static function main()
+ {
+ PHPUnit_TextUI_TestRunner::run(self::suite());
+ }
+
+ public static function suite()
+ {
+ $suite = new PHPUnit_Framework_TestSuite('Services_Atlassian_Crowd Tests');
+ $dir = new GlobIterator(dirname(__FILE__) . '/*Test.php');
+ $suite->addTestFiles($dir);
+ return $suite;
+ }
+}
+
+if ($call_main) {
+ Services_Atlassian_Crowd_AllTests::main();
+}
View
54 tests/test_config.inc.php
@@ -0,0 +1,54 @@
+<?php
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
+
+/**
+ * Services_Atlassian_Crowd tests configuration file.
+ *
+ * PHP version 5
+ *
+ * Copyright (C) 2010 Marcus Deglos
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @category Services
+ * @package Services_Atlassian_Crowd
+ * @author Luca Corbo <lucor@php.net>
+ * @author Marcus Deglos <marcus@deglos.com>
+ * @copyright 2010 Marcus Deglos
+ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License
+ * @link http://pear.php.net/packages/Services_Atlassian_Crowd
+ */
+
+//The values used in tests for the $option array
+global $crowd_options;
+$crowd_options = array(
+ 'app_name' => 'test',
+ 'app_credential' => 'test',
+ 'service_url' => 'http://localhost:8095/crowd/services/SecurityServer?wsdl',
+
+ 'username' => 'admin',
+ 'password' => 'admin',
+ 'user_agent' => '',
+ 'remote_address' => '127.0.0.1');
+
+if ($fp = @fopen('PHPUnit/Autoload.php', 'r', true)) {
+ require_once 'PHPUnit/Autoload.php';
+} elseif ($fp = @fopen('PHPUnit/Framework.php', 'r', true)) {
+ require_once 'PHPUnit/Framework.php';
+ require_once 'PHPUnit/TextUI/TestRunner.php';
+} else {
+ die('skip could not find PHPUnit');
+}
+fclose($fp);
+
+require_once 'Services/Atlassian/Crowd.php';
Please sign in to comment.
Something went wrong with that request. Please try again.