com php-src: add moar: tests/basic.test tests/code/class.php tests/commands/0001_basic.test tests/commands/0 002_set.test tests/commands/0100_compile
.test tests/commands/0101_info.test tests/run -tests.php tests/set.test
| From: | Bob Weinand | Date: | Thu, 05 Dec 2013 12:23:49 +0000 |
| Subject: | com php-src: add moar: tests/basic.test tests/code/class.php tests/commands/0001_basic.test tests/commands/0 002_set.test tests/commands/0100_compile .test tests/commands/0101_info.test tests/run -tests.php tests/set.test |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-75308@lists.php.net to get a copy of this message | ||
Commit: 6fc2ed61c4299dcc0dbfe36ab160a62f18880669
Author: krakjoe <joe.watkins@live.co.uk> Thu, 5 Dec 2013 12:23:49 +0000
Parents: ef33b778979ce9a336164c166f4acdb47778a7e4
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6fc2ed61c4299dcc0dbfe36ab160a62f18880669
Log:
add moar
Changed paths:
D tests/basic.test
A tests/code/class.php
A tests/commands/0001_basic..test
A tests/commands/0002_set.test
A tests/commands/0100_compile.test
A tests/commands/0101_info.test
M tests/run-tests.php
D tests/set.test
Diff:
diff --git a/tests/basic.test b/tests/basic.test
deleted file mode 100644
index 08aa9ab..0000000
--- a/tests/basic.test
+++ /dev/null
@@ -1,8 +0,0 @@
-#######################################################
-# name: basic
-# purpose: check basic functionality of phpdbg console
-# expect: TEST::EXACT
-# options: -rr
-#######################################################
-# [Nothing to execute!]
-#######################################################
diff --git a/tests/code/class.php b/tests/code/class.php
new file mode 100644
index 0000000..84efca9
--- /dev/null
+++ b/tests/code/class.php
@@ -0,0 +1,8 @@
+<?php
+class test {
+
+ public function testMethod(){}
+ private function testPrivateMethod(){}
+ protected function testProtectedMethod(){}
+}
+?>
diff --git a/tests/commands/0001_basic..test b/tests/commands/0001_basic.test
new file mode 100644
index 0000000..08aa9ab
--- /dev/null
+++ b/tests/commands/0001_basic.test
@@ -0,0 +1,8 @@
+#######################################################
+# name: basic
+# purpose: check basic functionality of phpdbg console
+# expect: TEST::EXACT
+# options: -rr
+#######################################################
+# [Nothing to execute!]
+#######################################################
diff --git a/tests/commands/0002_set.test b/tests/commands/0002_set.test
new file mode 100644
index 0000000..7720f94
--- /dev/null
+++ b/tests/commands/0002_set.test
@@ -0,0 +1,23 @@
+#################################################
+# name: set
+# purpose: tests for set commands
+# expect: TEST::CISTRING
+# options: -rr
+#################################################
+# setting prompt color
+# setting error color
+# setting notice color
+# Failed to find breakpoint #0
+# oplog disabled
+# not enabled
+# opened oplog test.log
+# nothing
+#################################################
+set color prompt none
+set color error none
+set color notice none
+set prompt promot>
+set break 0
+set oplog
+set oplog 0
+set oplog test.log
diff --git a/tests/commands/0100_compile.test b/tests/commands/0100_compile.test
new file mode 100644
index 0000000..9b71e04
--- /dev/null
+++ b/tests/commands/0100_compile.test
@@ -0,0 +1,13 @@
+#################################################
+# name: compile
+# purpose: test pre-compilation
+# expect: TEST::CISTRING
+# options: -rr
+#################################################
+# set execution context
+# attempting compilation
+# success
+#################################################
+exec sapi/phpdbg/tests/code/class.php
+compile
+q
diff --git a/tests/commands/0101_info.test b/tests/commands/0101_info.test
new file mode 100644
index 0000000..efacd37
--- /dev/null
+++ b/tests/commands/0101_info.test
@@ -0,0 +1,17 @@
+#################################################
+# name: info
+# purpose: test info commands
+# expect: TEST::CISTRING
+# options: -rr
+#################################################
+# set execution context
+# attempting compilation
+# success
+# user classes
+# user class test
+# |---- in
+#################################################
+exec sapi/phpdbg/tests/code/class.php
+compile
+info classes
+q
diff --git a/tests/run-tests.php b/tests/run-tests.php
index 397e91a..e3f26c2 100644
--- a/tests/run-tests.php
+++ b/tests/run-tests.php
@@ -152,25 +152,31 @@ namespace phpdbg\testing {
* @param string the path to log
*/
public function logPathStats($path) {
+ if (!isset($this->stats[$path])) {
+ return;
+ }
+
$total = array_sum($this->stats[$path]);
- @$this->totals[true] += $this->stats[$path][true];
- @$this->totals[false] += $this->stats[$path][false];
+ if ($total) {
+ @$this->totals[true] += $this->stats[$path][true];
+ @$this->totals[false] += $this->stats[$path][false];
- $stats = @sprintf(
- "%d/%d %%%d",
- $this->stats[$path][true],
- $this->stats[$path][false],
- (100 / $total) * $this->stats[$path][true]);
+ $stats = @sprintf(
+ "%d/%d %%%d",
+ $this->stats[$path][true],
+ $this->stats[$path][false],
+ (100 / $total) * $this->stats[$path][true]);
- printf(
- '%s [%s]%s',
- str_repeat(
- ' ', $this->config['width'] - strlen($stats)),
- $stats, PHP_EOL);
+ printf(
+ '%s [%s]%s',
+ str_repeat(
+ ' ', $this->config['width'] - strlen($stats)),
+ $stats, PHP_EOL);
- printf("%s%s", str_repeat('-', $this->config['width']+3),
PHP_EOL);
- printf("%s", PHP_EOL);
+ printf("%s%s", str_repeat('-', $this->config['width']+3),
PHP_EOL);
+ printf("%s", PHP_EOL);
+ }
}
/**
diff --git a/tests/set.test b/tests/set.test
deleted file mode 100644
index 7720f94...0000000
--- a/tests/set.test
+++ /dev/null
@@ -1,23 +0,0 @@
-#################################################
-# name: set
-# purpose: tests for set commands
-# expect: TEST::CISTRING
-# options: -rr
-#################################################
-# setting prompt color
-# setting error color
-# setting notice color
-# Failed to find breakpoint #0
-# oplog disabled
-# not enabled
-# opened oplog test.log
-# nothing
-#################################################
-set color prompt none
-set color error none
-set color notice none
-set prompt promot>
-set break 0
-set oplog
-set oplog 0
-set oplog test.log