diff --git a/lib/perl/Debian/Debhelper/Buildsystem/phppear.pm b/lib/perl/Debian/Debhelper/Buildsystem/phppear.pm
index 4e03bfe..08167ad 100644
--- a/lib/perl/Debian/Debhelper/Buildsystem/phppear.pm
+++ b/lib/perl/Debian/Debhelper/Buildsystem/phppear.pm
@@ -247,7 +247,10 @@ sub install {
 			}
 			# Remove tests files
 			if (!$ENV{PHPPEAR_KEEP_TESTS}) {
-				$this->doit_in_sourcedir('rm', '-rf', $destdir.'/usr/share/php/tests');
+				$this->doit_in_sourcedir('sed', '-i',
+					'-e', '/role="test">/,/<\/file>/d',
+					'-e', '/role="test" \/>/d',
+				$this->_get_peardir()."/package.xml");
 			}
 
 			# add package.xml and changelog to doc dir
