Skip to content
This repository has been archived by the owner on Nov 19, 2023. It is now read-only.

Commit

Permalink
Group imports
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Nov 30, 2019
1 parent c1be9fe commit eeccba9
Show file tree
Hide file tree
Showing 79 changed files with 144 additions and 295 deletions.
2 changes: 1 addition & 1 deletion src/main/php/unittest/AssertionFailedError.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ public function outcome(Test $test, Timer $timer) {
public function compoundMessage() {
return nameof($this).'{ '.$this->message.' }';
}
}
}
34 changes: 17 additions & 17 deletions src/main/php/unittest/ColorizingListener.class.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<?php namespace unittest;


/**
* Provide color enabling functionality to a testlistener
*
*/
interface ColorizingListener {

/**
* Enable color mode
*
* @param bool enable or NULL to autodetect capabilities
*/
public function setColor($enable);

/**
* Set color mode
*
* @param bool enable or NULL to autodetect capabilities
* @return self
*/
public function withColor($enable);
interface ColorizingListener {

/**
* Enable color mode
*
* @param bool enable or NULL to autodetect capabilities
*/
public function setColor($enable);

/**
* Set color mode
*
* @param bool enable or NULL to autodetect capabilities
* @return self
*/
public function withColor($enable);
}
3 changes: 1 addition & 2 deletions src/main/php/unittest/ComparisonFailedMessage.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php namespace unittest;

use lang\Generic;
use lang\Value;
use lang\{Generic, Value};
use util\Objects;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/unittest/IgnoredBecause.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ public function outcome(Test $test, Timer $timer) {
public function compoundMessage() {
return nameof($this).'{ '.$this->message.' }';
}
}
}
2 changes: 1 addition & 1 deletion src/main/php/unittest/Listener.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ public function testRunStarted(TestSuite $suite);
* @param unittest.TestResult $result
*/
public function testRunFinished(TestSuite $suite, TestResult $result);
}
}
2 changes: 1 addition & 1 deletion src/main/php/unittest/PrerequisitesFailedError.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ public function type() { return 'testFailed'; }
public function outcome(Test $test, Timer $timer) {
return new TestPrerequisitesFailed($test, $this, $timer->elapsedTime());
}
}
}
2 changes: 1 addition & 1 deletion src/main/php/unittest/PrerequisitesNotMetError.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ public function compoundMessage() {
Objects::stringOf($this->prerequisites)
);
}
}
}
2 changes: 1 addition & 1 deletion src/main/php/unittest/StopTests.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ public function __construct($reason) {
public function compoundMessage() {
return nameof($this).'('.$this->message.')';
}
}
}
3 changes: 1 addition & 2 deletions src/main/php/unittest/Test.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php namespace unittest;

use lang\Value;
use lang\XPClass;
use lang\{Value, XPClass};

abstract class Test implements Value {
public $instance, $method, $actions;
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/unittest/TestAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ public function beforeTest(Test $t);
* @return void
*/
public function afterTest(Test $t);
}
}
2 changes: 1 addition & 1 deletion src/main/php/unittest/TestAssertionFailed.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ public function __construct(Test $test, $reason, $elapsed) {
/** @return string */
protected function formatReason() { return $this->reason->toString(); }

}
}
2 changes: 1 addition & 1 deletion src/main/php/unittest/TestCase.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,4 @@ public function hashCode() {
public function compareTo($value) {
return $value instanceof self ? Objects::compare($this->name, $value->name) : 1;
}
}
}
3 changes: 1 addition & 2 deletions src/main/php/unittest/TestClass.class.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?php namespace unittest;

use lang\IllegalArgumentException;
use util\NoSuchElementException;
use util\Objects;
use util\{NoSuchElementException, Objects};

class TestClass extends TestGroup {
private $class, $actions, $arguments;
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/unittest/TestClassAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ public function beforeTestClass(\lang\XPClass $c);
* @return void
*/
public function afterTestClass(\lang\XPClass $c);
}
}
2 changes: 1 addition & 1 deletion src/main/php/unittest/TestError.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ public function __construct(Test $test, Throwable $reason, $elapsed) {

/** @return string */
protected function formatReason() { return $this->reason->toString(); }
}
}
2 changes: 1 addition & 1 deletion src/main/php/unittest/TestExpectationMet.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
*/
class TestExpectationMet extends TestSuccess {

}
}
2 changes: 1 addition & 1 deletion src/main/php/unittest/TestFailure.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ public function compareTo($value) {
: 1
;
}
}
}
3 changes: 1 addition & 2 deletions src/main/php/unittest/TestGroup.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php namespace unittest;

use lang\IllegalStateException;
use lang\XPClass;
use lang\{IllegalStateException, XPClass};
use lang\reflect\TargetInvocationException;

abstract class TestGroup {
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/unittest/TestListener.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ public function testRunStarted(TestSuite $suite);
* @param unittest.TestResult $result
*/
public function testRunFinished(TestSuite $suite, TestResult $result);
}
}
2 changes: 1 addition & 1 deletion src/main/php/unittest/TestNotRun.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ public function __construct(Test $test, $reason) {
parent::__construct($test, 0.0);
$this->reason= $reason;
}
}
}
2 changes: 1 addition & 1 deletion src/main/php/unittest/TestOutcome.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ public function compareTo($value) {
: 1
;
}
}
}
2 changes: 1 addition & 1 deletion src/main/php/unittest/TestPrerequisitesFailed.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ public function __construct(Test $test, PrerequisitesFailedError $reason, $elaps

/** @return string */
protected function formatReason() { return $this->reason->toString(); }
}
}
2 changes: 1 addition & 1 deletion src/main/php/unittest/TestPrerequisitesNotMet.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ public function __construct(Test $test, PrerequisitesNotMetError $reason, $elaps
parent::__construct($test, $elapsed);
$this->reason= $reason;
}
}
}
6 changes: 2 additions & 4 deletions src/main/php/unittest/TestResult.class.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?php namespace unittest;

use lang\Value;
use unittest\metrics\MemoryUsed;
use unittest\metrics\Metric;
use unittest\metrics\TimeTaken;
use unittest\metrics\{MemoryUsed, Metric, TimeTaken};
use util\Objects;

/**
Expand Down Expand Up @@ -194,4 +192,4 @@ public function compareTo($value) {
[$value->succeeded, $value->failed, $this->skipped]
);
}
}
}
2 changes: 1 addition & 1 deletion src/main/php/unittest/TestRun.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php namespace unittest;

use lang\reflect\TargetInvocationException;
use lang\{Throwable, XPClass};
use lang\reflect\TargetInvocationException;
use util\profiling\Timer;

class TestRun {
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/unittest/TestSkipped.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ public function compareTo($value) {
: 1
;
}
}
}
2 changes: 1 addition & 1 deletion src/main/php/unittest/TestStart.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ public function hashCode() {
public function compareTo($value) {
return $value instanceof self ? Objects::compare($this->test, $value->test) : 1;
}
}
}
2 changes: 1 addition & 1 deletion src/main/php/unittest/TestSuccess.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
*/
class TestSuccess extends TestOutcome {

}
}
6 changes: 2 additions & 4 deletions src/main/php/unittest/TestSuite.class.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?php namespace unittest;

use lang\IllegalArgumentException;
use lang\Value;
use lang\XPClass;
use lang\{IllegalArgumentException, Value, XPClass};
use util\Objects;

/**
Expand Down Expand Up @@ -219,4 +217,4 @@ public function hashCode() {
public function compareTo($value) {
return $value instanceof self ? Objects::compare($this->sources, $value->sources) : 1;
}
}
}
2 changes: 1 addition & 1 deletion src/main/php/unittest/TestVariation.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ public function getName($compound= false) {
public function hashCode() {
return md5($this->base->hashCode().$this->variation());
}
}
}
2 changes: 1 addition & 1 deletion src/main/php/unittest/TestWarning.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ public function __construct(Test $test, array $warnings, $elapsed) {
/** @return string */
protected function formatReason() { return $this->reason->compoundMessage(); }

}
}
6 changes: 2 additions & 4 deletions src/main/php/unittest/actions/ExtensionAvailable.class.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?php namespace unittest\actions;

use lang\Runtime;
use unittest\PrerequisitesNotMetError;
use unittest\Test;
use unittest\TestAction;
use unittest\{PrerequisitesNotMetError, Test, TestAction};

/**
* Only runs this testcase if a given PHP extension is available
Expand Down Expand Up @@ -54,4 +52,4 @@ public function beforeTest(Test $t) {
public function afterTest(Test $t) {
// Empty
}
}
}
6 changes: 2 additions & 4 deletions src/main/php/unittest/actions/IsPlatform.class.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?php namespace unittest\actions;

use unittest\PrerequisitesNotMetError;
use unittest\Test;
use unittest\TestAction;
use unittest\{PrerequisitesNotMetError, Test, TestAction};

/**
* Only runs this testcase on a given platform
Expand Down Expand Up @@ -72,4 +70,4 @@ public function beforeTest(Test $t) {
public function afterTest(Test $t) {
// Empty
}
}
}
6 changes: 2 additions & 4 deletions src/main/php/unittest/actions/RuntimeVersion.class.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?php namespace unittest\actions;

use unittest\PrerequisitesNotMetError;
use unittest\Test;
use unittest\TestAction;
use unittest\{PrerequisitesNotMetError, Test, TestAction};

/**
* Only runs this testcase on a given runtime version, e.g. PHP 5.4.0
Expand Down Expand Up @@ -113,4 +111,4 @@ public function beforeTest(Test $t) {
public function afterTest(Test $t) {
// Empty
}
}
}
11 changes: 3 additions & 8 deletions src/main/php/unittest/actions/VerifyThat.class.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
<?php namespace unittest\actions;

use lang\MethodNotImplementedException;
use lang\Throwable;
use lang\XPClass;
use unittest\PrerequisitesNotMetError;
use unittest\Test;
use unittest\TestAction;
use unittest\TestClassAction;
use lang\{MethodNotImplementedException, Throwable, XPClass};
use unittest\{PrerequisitesNotMetError, Test, TestAction, TestClassAction};

/**
* Verifies a certain callable works
Expand Down Expand Up @@ -112,4 +107,4 @@ public function beforeTestClass(XPClass $c) {
public function afterTestClass(XPClass $c) {
// Empty
}
}
}
2 changes: 1 addition & 1 deletion src/main/php/xp/unittest/ColoredBarListener.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,4 @@ public function testRunFinished(\unittest\TestSuite $suite, \unittest\TestResult
$this->out->writeLine($name, ': ', $metric->formatted());
}
}
}
}
9 changes: 3 additions & 6 deletions src/main/php/xp/unittest/DefaultListener.class.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<?php namespace xp\unittest;

use io\streams\ConsoleOutputStream;
use io\streams\OutputStreamWriter;
use unittest\ColorizingListener;
use unittest\Listener;
use unittest\TestStart;
use io\streams\{ConsoleOutputStream, OutputStreamWriter};
use unittest\{ColorizingListener, Listener, TestStart};

/**
* Default listener
Expand Down Expand Up @@ -188,4 +185,4 @@ public function testRunFinished(\unittest\TestSuite $suite, \unittest\TestResult
$this->out->writeLine($name, ': ', $metric->formatted());
}
}
}
}
Loading

0 comments on commit eeccba9

Please sign in to comment.