Elizabeth Marie Smith
2012-11-07 17:53:44 UTC
Commit: bc19302b392d2c5499b548ccc7a01fc1cc9299f9
Author: orlando <***@orlando-Latitude-E6410.(none)> Wed, 7 Nov 2012 14:53:44 -0300
Parents: ec48a455fd2151a8573250f221d175b405a35bab
Branches: master
Link: http://git.php.net/?p=php/gtk-src.git;a=commitdiff;h=bc19302b392d2c5499b548ccc7a01fc1cc9299f9
Log:
Added brackets around if on gtk_cell_layout_get_cells override in ext/gtk+/gtk-2.12.overrides
Added test/GtkCellLayout/get_cells.phpt
Changed paths:
M ext/gtk+/gtk-2.12.overrides
A tests/GtkCellLayout/get_cells.phpt
Diff:
diff --git a/ext/gtk+/gtk-2.12.overrides b/ext/gtk+/gtk-2.12.overrides
index 8728b56..f779014 100644
--- a/ext/gtk+/gtk-2.12.overrides
+++ b/ext/gtk+/gtk-2.12.overrides
@@ -685,8 +685,9 @@ PHP_METHOD
NOT_STATIC_METHOD();
- if (!php_gtk_parse_args(ZEND_NUM_ARGS(), ""))
+ if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "")){
return;
+ }
list = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(PHPG_GOBJECT(this_ptr)));
diff --git a/tests/GtkCellLayout/get_cells.phpt b/tests/GtkCellLayout/get_cells.phpt
new file mode 100644
index 0000000..4fc0fa6
--- /dev/null
+++ b/tests/GtkCellLayout/get_cells.phpt
@@ -0,0 +1,43 @@
+--TEST--
+GtkCellLayout->get_cells method
+--SKIPIF--
+<?php
+if(!extension_loaded('php-gtk')) die('skip - PHP-GTK extension not available');
+if($error = Gtk::check_version(2, 18, 0)) die('skip -requires GTK 2.18 or higher ' . $error);
+?>
+--INI--
+error_reporting = E_ALL | E_DEPRECATED;
+--FILE--
+<?php
+
+// Use any class that implements the GtkCellLayout interface
+
+// First try empty
+$column = new GtkTreeViewColumn();
+
+var_dump($column->get_cells());
+
+// Giving a paramenter should result in warning
+var_dump($column->get_cells(1));
+
+unset($column);
+
+// Now lets try with a cell renderer
+$column = new GtkTreeViewColumn("test", new GtkCellRendererText(), "text", 0);
+
+// Should return an array
+var_dump($column->get_cells());
+
+?>
+--EXPECTF--
+array(0) {
+}
+PHP Warning: GtkTreeViewColumn::get_cells() expects exactly 0 parameters, 1 given in %s on line %d
+NULL
+array(1) {
+ [0]=>
+ object(GtkCellRendererText)#2 (1) {
+ ["gtype"]=>
+ int(%i)
+ }
+}
Author: orlando <***@orlando-Latitude-E6410.(none)> Wed, 7 Nov 2012 14:53:44 -0300
Parents: ec48a455fd2151a8573250f221d175b405a35bab
Branches: master
Link: http://git.php.net/?p=php/gtk-src.git;a=commitdiff;h=bc19302b392d2c5499b548ccc7a01fc1cc9299f9
Log:
Added brackets around if on gtk_cell_layout_get_cells override in ext/gtk+/gtk-2.12.overrides
Added test/GtkCellLayout/get_cells.phpt
Changed paths:
M ext/gtk+/gtk-2.12.overrides
A tests/GtkCellLayout/get_cells.phpt
Diff:
diff --git a/ext/gtk+/gtk-2.12.overrides b/ext/gtk+/gtk-2.12.overrides
index 8728b56..f779014 100644
--- a/ext/gtk+/gtk-2.12.overrides
+++ b/ext/gtk+/gtk-2.12.overrides
@@ -685,8 +685,9 @@ PHP_METHOD
NOT_STATIC_METHOD();
- if (!php_gtk_parse_args(ZEND_NUM_ARGS(), ""))
+ if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "")){
return;
+ }
list = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(PHPG_GOBJECT(this_ptr)));
diff --git a/tests/GtkCellLayout/get_cells.phpt b/tests/GtkCellLayout/get_cells.phpt
new file mode 100644
index 0000000..4fc0fa6
--- /dev/null
+++ b/tests/GtkCellLayout/get_cells.phpt
@@ -0,0 +1,43 @@
+--TEST--
+GtkCellLayout->get_cells method
+--SKIPIF--
+<?php
+if(!extension_loaded('php-gtk')) die('skip - PHP-GTK extension not available');
+if($error = Gtk::check_version(2, 18, 0)) die('skip -requires GTK 2.18 or higher ' . $error);
+?>
+--INI--
+error_reporting = E_ALL | E_DEPRECATED;
+--FILE--
+<?php
+
+// Use any class that implements the GtkCellLayout interface
+
+// First try empty
+$column = new GtkTreeViewColumn();
+
+var_dump($column->get_cells());
+
+// Giving a paramenter should result in warning
+var_dump($column->get_cells(1));
+
+unset($column);
+
+// Now lets try with a cell renderer
+$column = new GtkTreeViewColumn("test", new GtkCellRendererText(), "text", 0);
+
+// Should return an array
+var_dump($column->get_cells());
+
+?>
+--EXPECTF--
+array(0) {
+}
+PHP Warning: GtkTreeViewColumn::get_cells() expects exactly 0 parameters, 1 given in %s on line %d
+NULL
+array(1) {
+ [0]=>
+ object(GtkCellRendererText)#2 (1) {
+ ["gtype"]=>
+ int(%i)
+ }
+}
--
PHP-GTK CVS Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
PHP-GTK CVS Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php