Bug 172491 - [NEW PORT] devel/pecl-test_helpers: An extension to ease testing of PHP code
Summary: [NEW PORT] devel/pecl-test_helpers: An extension to ease testing of PHP code
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-08 16:40 UTC by Gasol Wu
Modified: 2012-12-29 12:20 UTC (History)
0 users

See Also:


Attachments
.shar (4.72 KB, text/plain)
2012-10-08 16:40 UTC, Gasol Wu
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gasol Wu 2012-10-08 16:40:12 UTC
- patch based on https://github.com/sebastianbergmann/php-test-helpers/pull/16
- Add notes for combination with other extensions

test_helpers is an extension for the PHP Interpreter to ease testing of
PHP code.

WWW: https://github.com/sebastianbergmann/php-test-helpers

Generated with FreeBSD Port Tools 0.99_6 (mode: new)
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-10-08 16:40:33 UTC
Responsible Changed
From-To: freebsd-ports-bugs->miwi

miwi@ wants this port PRs (via the GNATS Auto Assign Tool)
Comment 2 Baptiste Daroussin freebsd_committer freebsd_triage 2012-10-29 09:40:38 UTC
Responsible Changed
From-To: miwi->freebsd-ports-bugs

Reassign to the heap miwi being overloaded for now
Comment 3 dfilter service freebsd_committer freebsd_triage 2012-12-29 12:19:05 UTC
Author: pawel
Date: Sat Dec 29 12:18:56 2012
New Revision: 309616
URL: http://svnweb.freebsd.org/changeset/ports/309616

Log:
  test_helpers is an extension for the PHP Interpreter to ease
  testing of PHP code.
  
  WWW: https://github.com/sebastianbergmann/php-test-helpers
  
  PR:		ports/172491
  Submitted by:	Gasol Wu <gasol.wu@gmail.com>

Added:
  head/devel/pecl-test_helpers/
  head/devel/pecl-test_helpers/Makefile   (contents, props changed)
  head/devel/pecl-test_helpers/distinfo   (contents, props changed)
  head/devel/pecl-test_helpers/files/
  head/devel/pecl-test_helpers/files/patch-test_helpers.c   (contents, props changed)
  head/devel/pecl-test_helpers/files/pkg-message.in   (contents, props changed)
  head/devel/pecl-test_helpers/pkg-descr   (contents, props changed)
Modified:
  head/devel/Makefile

Modified: head/devel/Makefile
==============================================================================
--- head/devel/Makefile	Sat Dec 29 10:07:58 2012	(r309615)
+++ head/devel/Makefile	Sat Dec 29 12:18:56 2012	(r309616)
@@ -3140,6 +3140,7 @@
     SUBDIR += pecl-spread
     SUBDIR += pecl-statgrab
     SUBDIR += pecl-svn
+    SUBDIR += pecl-test_helpers
     SUBDIR += pecl-uploadprogress
     SUBDIR += pecl-uuid
     SUBDIR += pecl-vld

Added: head/devel/pecl-test_helpers/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/pecl-test_helpers/Makefile	Sat Dec 29 12:18:56 2012	(r309616)
@@ -0,0 +1,25 @@
+# Created by: Gasol Wu <gasol.wu@gmail.com>
+# $FreeBSD$
+
+PORTNAME=	test_helpers
+PORTVERSION=	1.1.0
+CATEGORIES=	devel pear
+MASTER_SITES=	http://pear.phpunit.de/get/
+PKGNAMEPREFIX=	pecl-
+EXTRACT_SUFX=	.tgz
+
+MAINTAINER=	gasol.wu@gmail.com
+COMMENT=	Extension to ease testing of PHP code
+
+CONFIGURE_ARGS=	--enable-test-helpers
+USE_PHP=	yes
+USE_PHPEXT=	yes
+USE_PHPIZE=	yes
+SUB_FILES=	pkg-message
+
+PKGMESSAGE=	${WRKDIR}/pkg-message
+
+post-install:
+	@${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.mk>

Added: head/devel/pecl-test_helpers/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/pecl-test_helpers/distinfo	Sat Dec 29 12:18:56 2012	(r309616)
@@ -0,0 +1,2 @@
+SHA256 (test_helpers-1.1.0.tgz) = 4fc53f6b8b7881dc3fbcfdaa08428dab59caf2e22c8df588eb5182055d095c6d
+SIZE (test_helpers-1.1.0.tgz) = 10370

Added: head/devel/pecl-test_helpers/files/patch-test_helpers.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/pecl-test_helpers/files/patch-test_helpers.c	Sat Dec 29 12:18:56 2012	(r309616)
@@ -0,0 +1,57 @@
+--- ./test_helpers.c.orig	2010-10-25 15:05:08.000000000 +0800
++++ ./test_helpers.c	2012-10-08 17:41:40.355030000 +0800
+@@ -102,14 +102,30 @@
+ 	case IS_CONST:
+ 		return &(node->u.constant);
+ 	case IS_VAR:
++#if ZEND_EXTENSION_API_NO >= 220100525
++		return EX_T(node->u.op.var).var.ptr;
++#else
+ 		return EX_T(node->u.var).var.ptr;
++#endif
+ 	case IS_TMP_VAR:
++#if ZEND_EXTENSION_API_NO >= 220100525
++		return (*freeval = &EX_T(node->u.op.var).tmp_var);
++#else
+ 		return (*freeval = &EX_T(node->u.var).tmp_var);
++#endif
+ 	case IS_CV:
+ 		{
++#if ZEND_EXTENSION_API_NO >= 220100525
++		zval ***ret = &execute_data->CVs[node->u.op.var];
++#else
+ 		zval ***ret = &execute_data->CVs[node->u.var];
++#endif
+ 		if (!*ret) {
++#if ZEND_EXTENSION_API_NO >= 220100525
++				zend_compiled_variable *cv = &EG(active_op_array)->vars[node->u.op.var];
++#else
+ 				zend_compiled_variable *cv = &EG(active_op_array)->vars[node->u.var];
++#endif
+ 				if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void**)ret)==FAILURE) {
+ 					zend_error(E_NOTICE, "Undefined variable: %s", cv->name);
+ 					return &EG(uninitialized_zval);
+@@ -165,7 +181,11 @@
+ 		}
+ 	}
+ 
++#if ZEND_EXTENSION_API_NO >= 220100525
++	old_ce = EX_T(opline->op1.var).class_entry;
++#else
+ 	old_ce = EX_T(opline->op1.u.var).class_entry;
++#endif
+ 
+ 	MAKE_STD_ZVAL(arg);
+ 	ZVAL_STRINGL(arg, old_ce->name, old_ce->name_length, 1);
+@@ -189,7 +209,11 @@
+ 	zval_ptr_dtor(&retval);
+ 
+ 
++#if ZEND_EXTENSION_API_NO >= 220100525
++	EX_T(opline->op1.var).class_entry = *new_ce;
++#else
+ 	EX_T(opline->op1.u.var).class_entry = *new_ce;
++#endif
+ 
+ 	if (old_new_handler) {
+ 		return old_new_handler(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);

Added: head/devel/pecl-test_helpers/files/pkg-message.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/pecl-test_helpers/files/pkg-message.in	Sat Dec 29 12:18:56 2012	(r309616)
@@ -0,0 +1,22 @@
+*****************************************************************************
+The php extension 'test_helpers' has been installed successful.
+Add a line containing
+
+	extension=%%PREFIX%%/lib/php/%%PHP_EXT_DIR%%/test_helpers.so
+
+or
+
+	zend_extension=%%PREFIX%%/lib/php/%%PHP_EXT_DIR%%/test_helpers.so
+
+If this extension is used in combination with other extensions, such as Xdebug,
+which are also overloading the `ZEND_NEW` opcode you have to load it as 
+`zend_extension` after loading the conflicting extension. This can be done in 
+your `php.ini` like this:
+
+    zend_extension=xdebug.so
+    zend_extension=test-helpers.so
+
+Please refer to `phpinfo()` to verify whether a conflict was detected and 
+whether the work-around was enabled.
+
+*****************************************************************************

Added: head/devel/pecl-test_helpers/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/pecl-test_helpers/pkg-descr	Sat Dec 29 12:18:56 2012	(r309616)
@@ -0,0 +1,4 @@
+test_helpers is an extension for the PHP Interpreter to ease
+testing of PHP code.
+
+WWW: https://github.com/sebastianbergmann/php-test-helpers
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 4 Pawel Pekala freebsd_committer freebsd_triage 2012-12-29 12:19:18 UTC
State Changed
From-To: open->closed

New port added. Thanks!