Hello community, here is the log from the commit of package php5-pear-Horde_Constraint for openSUSE:Factory checked in at 2012-02-16 12:26:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/php5-pear-Horde_Constraint (Old) and /work/SRC/openSUSE:Factory/.php5-pear-Horde_Constraint.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "php5-pear-Horde_Constraint", Maintainer is "" Changes: -------- --- /work/SRC/openSUSE:Factory/php5-pear-Horde_Constraint/php5-pear-Horde_Constraint.changes 2011-09-23 12:40:14.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.php5-pear-Horde_Constraint.new/php5-pear-Horde_Constraint.changes 2012-02-16 12:26:24.000000000 +0100 @@ -1,0 +2,7 @@ +Tue Jan 10 10:09:37 UTC 2012 - lang@b1-systems.de + +- version 1.0.1 +- ships license file +- [jan] Fix tests to work with PHPUnit 3.6. + +------------------------------------------------------------------- Old: ---- Horde_Constraint-1.0.0.tgz New: ---- Horde_Constraint-1.0.1.tgz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ php5-pear-Horde_Constraint.spec ++++++ --- /var/tmp/diff_new_pack.MWolWX/_old 2012-02-16 12:26:27.000000000 +0100 +++ /var/tmp/diff_new_pack.MWolWX/_new 2012-02-16 12:26:27.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package php5-pear-Horde_Constraint # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2011 Ralf Lang. # # All modifications and additions to the file contributed by third parties @@ -16,16 +16,14 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # - Summary: PEAR: Horde Constraint library - +License: BSD-2-Clause +Group: Development/Libraries/PHP Name: php5-pear-Horde_Constraint %define pear_name Horde_Constraint %define pear_sname horde_constraint -Version: 1.0.0 -Release: 1 -License: BSD -Group: Development/Libraries/PHP +Version: 1.0.1 +Release: 0 Source0: http://pear.horde.org/get/Horde_Constraint-%{version}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-build Url: http://pear.horde.org/package/Horde_Constraint @@ -92,4 +90,5 @@ %files -f %{name}.files %defattr(-,root,root) + %changelog ++++++ Horde_Constraint-1.0.0.tgz -> Horde_Constraint-1.0.1.tgz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.0/lib/Horde/Constraint/AlwaysFalse.php new/Horde_Constraint-1.0.0/lib/Horde/Constraint/AlwaysFalse.php --- old/Horde_Constraint-1.0.0/lib/Horde/Constraint/AlwaysFalse.php 2011-04-06 01:06:56.000000000 +0200 +++ new/Horde_Constraint-1.0.0/lib/Horde/Constraint/AlwaysFalse.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,13 +0,0 @@ -<?php -/** - * Always returns false - * - * @author James Pepin <james@jamespepin.com> - */ -class Horde_Constraint_AlwaysFalse implements Horde_Constraint -{ - public function evaluate($value) - { - return false; - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.0/lib/Horde/Constraint/AlwaysTrue.php new/Horde_Constraint-1.0.0/lib/Horde/Constraint/AlwaysTrue.php --- old/Horde_Constraint-1.0.0/lib/Horde/Constraint/AlwaysTrue.php 2011-04-06 01:06:56.000000000 +0200 +++ new/Horde_Constraint-1.0.0/lib/Horde/Constraint/AlwaysTrue.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,13 +0,0 @@ -<?php -/** - * Always returns true - * - * @author James Pepin <james@jamespepin.com> - */ -class Horde_Constraint_AlwaysTrue implements Horde_Constraint -{ - public function evaluate($value) - { - return true; - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.0/lib/Horde/Constraint/And.php new/Horde_Constraint-1.0.0/lib/Horde/Constraint/And.php --- old/Horde_Constraint-1.0.0/lib/Horde/Constraint/And.php 2011-04-06 01:06:56.000000000 +0200 +++ new/Horde_Constraint-1.0.0/lib/Horde/Constraint/And.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,21 +0,0 @@ -<?php -/** - * Represents a collection of constraints, if one is false, this collection will - * evaluate to false - * - * Based on PHPUnit_Framework_Constraint_And - * - * @author James Pepin <james@jamespepin.com> - */ -class Horde_Constraint_And extends Horde_Constraint_Coupler -{ - public function evaluate($value) - { - foreach ($this->_constraints as $c) { - if (!$c->evaluate($value)) { - return false; - } - } - return true; - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.0/lib/Horde/Constraint/Coupler.php new/Horde_Constraint-1.0.0/lib/Horde/Constraint/Coupler.php --- old/Horde_Constraint-1.0.0/lib/Horde/Constraint/Coupler.php 2011-04-06 01:06:56.000000000 +0200 +++ new/Horde_Constraint-1.0.0/lib/Horde/Constraint/Coupler.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,39 +0,0 @@ -<?php -/** - * Interface for grouped (compound, coupled) constraints. - * - * @author James Pepin <james@jamespepin.com> - */ -abstract class Horde_Constraint_Coupler implements Horde_Constraint -{ - protected $_constraints = array(); - - public function __construct() - { - $constraints = func_get_args(); - foreach ($constraints as $c) { - if (! $c instanceof Horde_Constraint) { - throw new IllegalArgumentException("$c does not implement Horde_Constraint"); - } - $this->addConstraint($c); - } - } - - public function addConstraint(Horde_Constraint $constraint) - { - $kind = get_class($this); - if ($constraint instanceof $kind) { - foreach ($constraint->getConstraints() as $c) { - $this->addConstraint($c); - } - } else { - $this->_constraints[] = $constraint; - } - return $this; - } - - public function getConstraints() - { - return $this->_constraints; - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.0/lib/Horde/Constraint/IsEqual.php new/Horde_Constraint-1.0.0/lib/Horde/Constraint/IsEqual.php --- old/Horde_Constraint-1.0.0/lib/Horde/Constraint/IsEqual.php 2011-04-06 01:06:56.000000000 +0200 +++ new/Horde_Constraint-1.0.0/lib/Horde/Constraint/IsEqual.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,22 +0,0 @@ -<?php -/** - * Checks for equality - * - * Based on PHPUnit_Framework_Constraint_IsEqual - * - * @author James Pepin <james@jamespepin.com> - */ -class Horde_Constraint_IsEqual implements Horde_Constraint -{ - private $_value; - - public function __construct($value) - { - $this->_value = $value; - } - - public function evaluate($value) - { - return $this->_value == $value; - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.0/lib/Horde/Constraint/IsInstanceOf.php new/Horde_Constraint-1.0.0/lib/Horde/Constraint/IsInstanceOf.php --- old/Horde_Constraint-1.0.0/lib/Horde/Constraint/IsInstanceOf.php 2011-04-06 01:06:56.000000000 +0200 +++ new/Horde_Constraint-1.0.0/lib/Horde/Constraint/IsInstanceOf.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,22 +0,0 @@ -<?php -/** - * Checks for an instance of a class - * - * Based on PHPUnit_Framework_Constraint_IsInstanceOf - * - * @author James Pepin <james@jamespepin.com> - */ -class Horde_Constraint_IsInstanceOf implements Horde_Constraint -{ - private $_type; - - public function __construct($type) - { - $this->_type = $type; - } - - public function evaluate($value) - { - return $value instanceof $this->_type; - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.0/lib/Horde/Constraint/Not.php new/Horde_Constraint-1.0.0/lib/Horde/Constraint/Not.php --- old/Horde_Constraint-1.0.0/lib/Horde/Constraint/Not.php 2011-04-06 01:06:56.000000000 +0200 +++ new/Horde_Constraint-1.0.0/lib/Horde/Constraint/Not.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,22 +0,0 @@ -<?php -/** - * Negates another constraint - * - * Based on PHPUnit_Framework_Constraint_Not - * - * @author James Pepin <james@jamespepin.com> - */ -class Horde_Constraint_Not implements Horde_Constraint -{ - private $_constraint; - - public function __construct(Horde_Constraint $constraint) - { - $this->_constraint = $constraint; - } - - public function evaluate($value) - { - return !$this->_constraint->evaluate($value); - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.0/lib/Horde/Constraint/Null.php new/Horde_Constraint-1.0.0/lib/Horde/Constraint/Null.php --- old/Horde_Constraint-1.0.0/lib/Horde/Constraint/Null.php 2011-04-06 01:06:56.000000000 +0200 +++ new/Horde_Constraint-1.0.0/lib/Horde/Constraint/Null.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,15 +0,0 @@ -<?php -/** - * Checks if the value is null - * - * Based on PHPUnit_Framework_Constraint_Null - * - * @author James Pepin <james@jamespepin.com> - */ -class Horde_Constraint_Null implements Horde_Constraint -{ - public function evaluate($value) - { - return is_null($value); - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.0/lib/Horde/Constraint/Or.php new/Horde_Constraint-1.0.0/lib/Horde/Constraint/Or.php --- old/Horde_Constraint-1.0.0/lib/Horde/Constraint/Or.php 2011-04-06 01:06:56.000000000 +0200 +++ new/Horde_Constraint-1.0.0/lib/Horde/Constraint/Or.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,19 +0,0 @@ -<?php -/** - * Represents a collection of constraints, if any are true, the collection will evaluate to true. - * - * @author James Pepin <james@jamespepin.com> - * @author Chuck Hagenbuch <chuck@horde.org> - */ -class Horde_Constraint_Or extends Horde_Constraint_Coupler -{ - public function evaluate($value) - { - foreach ($this->_constraints as $c) { - if ($c->evaluate($value)) { - return true; - } - } - return false; - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.0/lib/Horde/Constraint/PregMatch.php new/Horde_Constraint-1.0.0/lib/Horde/Constraint/PregMatch.php --- old/Horde_Constraint-1.0.0/lib/Horde/Constraint/PregMatch.php 2011-04-06 01:06:56.000000000 +0200 +++ new/Horde_Constraint-1.0.0/lib/Horde/Constraint/PregMatch.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,22 +0,0 @@ -<?php -/** - * Matches against a PCRE regex - * - * Based on PHPUnit_Framework_Constraint_PCREMatch - * - * @author James Pepin <james@jamespepin.com> - */ -class Horde_Constraint_PregMatch implements Horde_Constraint -{ - private $_regex; - - public function __construct($regex) - { - $this->_regex = $regex; - } - - public function evaluate($value) - { - return preg_match($this->_regex, $value) > 0; - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.0/lib/Horde/Constraint.php new/Horde_Constraint-1.0.0/lib/Horde/Constraint.php --- old/Horde_Constraint-1.0.0/lib/Horde/Constraint.php 2011-04-06 01:06:56.000000000 +0200 +++ new/Horde_Constraint-1.0.0/lib/Horde/Constraint.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,10 +0,0 @@ -<?php -/** - * Interface for constraints. - * - * @author James Pepin <james@jamespepin.com> - */ -interface Horde_Constraint -{ - public function evaluate($value); -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.0/test/Horde/Constraint/AllTests.php new/Horde_Constraint-1.0.0/test/Horde/Constraint/AllTests.php --- old/Horde_Constraint-1.0.0/test/Horde/Constraint/AllTests.php 2011-04-06 01:06:56.000000000 +0200 +++ new/Horde_Constraint-1.0.0/test/Horde/Constraint/AllTests.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,32 +0,0 @@ -<?php -/** - * @package Constraint - * @subpackage UnitTests - */ - -/** - * Define the main method - */ -if (!defined('PHPUnit_MAIN_METHOD')) { - define('PHPUnit_MAIN_METHOD', 'Horde_Constraint_AllTests::main'); -} - -/** - * Prepare the test setup. - */ -require_once 'Horde/Test/AllTests.php'; -set_include_path(dirname(__FILE__) . '/../../' . PATH_SEPARATOR . get_include_path()); - -/** - * @package Constraint - * @subpackage UnitTests - */ -class Horde_Constraint_AllTests extends Horde_Test_AllTests -{ -} - -Horde_Constraint_AllTests::init('Horde_Constraint', __FILE__); - -if (PHPUnit_MAIN_METHOD == 'Horde_Constraint_AllTests::main') { - Horde_Constraint_AllTests::main(); -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.0/test/Horde/Constraint/AlwaysFalseTest.php new/Horde_Constraint-1.0.0/test/Horde/Constraint/AlwaysFalseTest.php --- old/Horde_Constraint-1.0.0/test/Horde/Constraint/AlwaysFalseTest.php 2011-04-06 01:06:56.000000000 +0200 +++ new/Horde_Constraint-1.0.0/test/Horde/Constraint/AlwaysFalseTest.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,22 +0,0 @@ -<?php -class Horde_Constraint_AlwaysFalseTest extends Horde_Test_Case -{ - public static function randomObjectProvider() - { - return array( - array('teststring'), - array(''), - array(true), - array(false), - ); - } - - /** - * @dataProvider randomObjectProvider - */ - public function testEvaluateIsAlwaysFalse($value) - { - $const = new Horde_Constraint_AlwaysFalse(); - $this->assertFalse($const->evaluate($value)); - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.0/test/Horde/Constraint/AlwaysTrueTest.php new/Horde_Constraint-1.0.0/test/Horde/Constraint/AlwaysTrueTest.php --- old/Horde_Constraint-1.0.0/test/Horde/Constraint/AlwaysTrueTest.php 2011-04-06 01:06:56.000000000 +0200 +++ new/Horde_Constraint-1.0.0/test/Horde/Constraint/AlwaysTrueTest.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,22 +0,0 @@ -<?php -class Horde_Constraint_AlwaysTrueTest extends Horde_Test_Case -{ - public static function randomObjectProvider() - { - return array( - array('teststring'), - array(''), - array(true), - array(false), - ); - } - - /** - * @dataProvider randomObjectProvider - */ - public function testEvaluateIsAlwaysTrue($value) - { - $const = new Horde_Constraint_AlwaysTrue(); - $this->assertTrue($const->evaluate($value)); - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.0/test/Horde/Constraint/AndTest.php new/Horde_Constraint-1.0.0/test/Horde/Constraint/AndTest.php --- old/Horde_Constraint-1.0.0/test/Horde/Constraint/AndTest.php 2011-04-06 01:06:56.000000000 +0200 +++ new/Horde_Constraint-1.0.0/test/Horde/Constraint/AndTest.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,63 +0,0 @@ -<?php -class Horde_Constraint_AndTest extends Horde_Test_Case -{ - public function testAndEvaluatesFalseWhenOneConstraintIsFalse() - { - $c1 = new Horde_Constraint_AlwaysTrue(); - $c2 = new Horde_Constraint_AlwaysFalse(); - $and = new Horde_Constraint_And($c1, $c2); - - $this->assertFalse($and->evaluate('test_string')); - } - - public function testAndEvaluatesFalseWhenBothConstraintsAreFalse() - { - $c1 = new Horde_Constraint_AlwaysFalse(); - $c2 = new Horde_Constraint_AlwaysFalse(); - $and = new Horde_Constraint_And($c1, $c2); - - $this->assertFalse($and->evaluate('test_string')); - } - - public function testAndEvaluatesTrueWhenBothConstraintsAreTrue() - { - $c1 = new Horde_Constraint_AlwaysTrue(); - $c2 = new Horde_Constraint_AlwaysTrue(); - $and = new Horde_Constraint_And($c1, $c2); - - $this->assertTrue($and->evaluate('test_string')); - } - - public function testAndEvaluatesFalseWhenFalseConstraintIsAddedViaSetter() - { - $c1 = new Horde_Constraint_AlwaysTrue(); - $c2 = new Horde_Constraint_AlwaysTrue(); - $and = new Horde_Constraint_And($c1, $c2); - - $and->addConstraint(new Horde_Constraint_AlwaysFalse()); - - $this->assertFalse($and->evaluate('test_string')); - } - - public function testAndaddConstraintReturnsAndConstraint() - { - $c1 = new Horde_Constraint_AlwaysTrue(); - $c2 = new Horde_Constraint_AlwaysTrue(); - $and = new Horde_Constraint_And($c1, $c2); - - $returnConst = $and->addConstraint(new Horde_Constraint_AlwaysFalse()); - - $this->assertType('Horde_Constraint_And', $returnConst); - } - - public function testReturnedAndEvaluatesFalseWhenFalseConstraintIsAddedViaSetter() - { - $c1 = new Horde_Constraint_AlwaysTrue(); - $c2 = new Horde_Constraint_AlwaysTrue(); - $and = new Horde_Constraint_And($c1, $c2); - - $and = $and->addConstraint(new Horde_Constraint_AlwaysFalse()); - - $this->assertFalse($and->evaluate('test_string')); - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.0/test/Horde/Constraint/IsInstanceOfTest.php new/Horde_Constraint-1.0.0/test/Horde/Constraint/IsInstanceOfTest.php --- old/Horde_Constraint-1.0.0/test/Horde/Constraint/IsInstanceOfTest.php 2011-04-06 01:06:56.000000000 +0200 +++ new/Horde_Constraint-1.0.0/test/Horde/Constraint/IsInstanceOfTest.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,19 +0,0 @@ -<?php -class Horde_Constraint_IsInstanceOfTest extends Horde_Test_Case -{ - public function testConstraintReturnsFalseWhenInstanceIsWrongClass() - { - $foo = new StdClass(); - $const = new Horde_Constraint_IsInstanceOf('FakeClassName'); - - $this->assertFalse($const->evaluate($foo)); - } - - public function testConstraintReturnsTrueWhenInstanceIsCorrectClass() - { - $foo = new StdClass(); - $const = new Horde_Constraint_IsInstanceOf('StdClass'); - - $this->assertTrue($const->evaluate($foo)); - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.0/test/Horde/Constraint/NotTest.php new/Horde_Constraint-1.0.0/test/Horde/Constraint/NotTest.php --- old/Horde_Constraint-1.0.0/test/Horde/Constraint/NotTest.php 2011-04-06 01:06:56.000000000 +0200 +++ new/Horde_Constraint-1.0.0/test/Horde/Constraint/NotTest.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,15 +0,0 @@ -<?php -class Horde_Constraint_NotTest extends Horde_Test_Case -{ - public function testNotMakesFalseConstraintTrue() - { - $not = new Horde_Constraint_Not(new Horde_Constraint_AlwaysFalse()); - $this->assertTrue($not->evaluate('foo')); - } - - public function testNotMakesTrueConstraintFalse() - { - $not = new Horde_Constraint_Not(new Horde_Constraint_AlwaysTrue()); - $this->assertFalse($not->evaluate('foo')); - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.0/test/Horde/Constraint/NullTest.php new/Horde_Constraint-1.0.0/test/Horde/Constraint/NullTest.php --- old/Horde_Constraint-1.0.0/test/Horde/Constraint/NullTest.php 2011-04-06 01:06:56.000000000 +0200 +++ new/Horde_Constraint-1.0.0/test/Horde/Constraint/NullTest.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,15 +0,0 @@ -<?php -class Horde_Constraint_NullTest extends Horde_Test_Case -{ - public function testNullReturnsTrueWhenValueisNull() - { - $const = new Horde_Constraint_Null(); - $this->assertTrue($const->evaluate(null)); - } - - public function testNullReturnsFalseWhenValue_IsNot_Null() - { - $const = new Horde_Constraint_Null(); - $this->assertFalse($const->evaluate('not null value')); - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.0/test/Horde/Constraint/OrTest.php new/Horde_Constraint-1.0.0/test/Horde/Constraint/OrTest.php --- old/Horde_Constraint-1.0.0/test/Horde/Constraint/OrTest.php 2011-04-06 01:06:56.000000000 +0200 +++ new/Horde_Constraint-1.0.0/test/Horde/Constraint/OrTest.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,63 +0,0 @@ -<?php -class Horde_Constraint_OrTest extends Horde_Test_Case -{ - public function testOrEvaluatesTrueWhenOneConstraintIsTrue() - { - $c1 = new Horde_Constraint_AlwaysTrue(); - $c2 = new Horde_Constraint_AlwaysFalse(); - $or = new Horde_Constraint_Or($c1, $c2); - - $this->assertTrue($or->evaluate('test_string')); - } - - public function testOrEvaluatesFalseWhenBothConstraintsAreFalse() - { - $c1 = new Horde_Constraint_AlwaysFalse(); - $c2 = new Horde_Constraint_AlwaysFalse(); - $or = new Horde_Constraint_Or($c1, $c2); - - $this->assertFalse($or->evaluate('test_string')); - } - - public function testOrEvaluatesTrueWhenBothConstraintsAreTrue() - { - $c1 = new Horde_Constraint_AlwaysTrue(); - $c2 = new Horde_Constraint_AlwaysTrue(); - $or = new Horde_Constraint_Or($c1, $c2); - - $this->assertTrue($or->evaluate('test_string')); - } - - public function testOrEvaluatesTrueWhenTrueConstraintIsAddedViaSetter() - { - $c1 = new Horde_Constraint_AlwaysFalse(); - $c2 = new Horde_Constraint_AlwaysFalse(); - $or = new Horde_Constraint_Or($c1, $c2); - - $or->addConstraint(new Horde_Constraint_AlwaysTrue()); - - $this->assertTrue($or->evaluate('test_string')); - } - - public function testOraddConstraintReturnsOrConstraint() - { - $c1 = new Horde_Constraint_AlwaysTrue(); - $c2 = new Horde_Constraint_AlwaysTrue(); - $or = new Horde_Constraint_Or($c1, $c2); - - $returnConst = $or->addConstraint(new Horde_Constraint_AlwaysFalse()); - - $this->assertType('Horde_Constraint_Or', $returnConst); - } - - public function testReturnedOrEvaluatesTrueWhenTrueConstraintIsAddedViaSetter() - { - $c1 = new Horde_Constraint_AlwaysFalse(); - $c2 = new Horde_Constraint_AlwaysFalse(); - $or = new Horde_Constraint_Or($c1, $c2); - - $or = $or->addConstraint(new Horde_Constraint_AlwaysTrue()); - - $this->assertTrue($or->evaluate('test_string')); - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.0/test/Horde/Constraint/PregMatchTest.php new/Horde_Constraint-1.0.0/test/Horde/Constraint/PregMatchTest.php --- old/Horde_Constraint-1.0.0/test/Horde/Constraint/PregMatchTest.php 2011-04-06 01:06:56.000000000 +0200 +++ new/Horde_Constraint-1.0.0/test/Horde/Constraint/PregMatchTest.php 1970-01-01 01:00:00.000000000 +0100 @@ -1,15 +0,0 @@ -<?php -class Horde_Constraint_PregMatchTest extends Horde_Test_Case -{ - public function testPregReturnsTrueWhenRegexMatches() - { - $preg = new Horde_Constraint_PregMatch('/somestring/'); - $this->assertTrue($preg->evaluate('somestring')); - } - - public function testPregReturnsFalseWhenRegex_DoesNot_Match() - { - $preg = new Horde_Constraint_PregMatch('/somestring/'); - $this->assertFalse($preg->evaluate('some other string')); - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.1/doc/Horde/Constraint/COPYING new/Horde_Constraint-1.0.1/doc/Horde/Constraint/COPYING --- old/Horde_Constraint-1.0.1/doc/Horde/Constraint/COPYING 1970-01-01 01:00:00.000000000 +0100 +++ new/Horde_Constraint-1.0.1/doc/Horde/Constraint/COPYING 2011-11-22 14:52:46.000000000 +0100 @@ -0,0 +1,24 @@ + Copyright 1999-2011 Horde LLC. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE HORDE PROJECT +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.1/lib/Horde/Constraint/AlwaysFalse.php new/Horde_Constraint-1.0.1/lib/Horde/Constraint/AlwaysFalse.php --- old/Horde_Constraint-1.0.1/lib/Horde/Constraint/AlwaysFalse.php 1970-01-01 01:00:00.000000000 +0100 +++ new/Horde_Constraint-1.0.1/lib/Horde/Constraint/AlwaysFalse.php 2011-11-22 14:52:46.000000000 +0100 @@ -0,0 +1,13 @@ +<?php +/** + * Always returns false + * + * @author James Pepin <james@jamespepin.com> + */ +class Horde_Constraint_AlwaysFalse implements Horde_Constraint +{ + public function evaluate($value) + { + return false; + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.1/lib/Horde/Constraint/AlwaysTrue.php new/Horde_Constraint-1.0.1/lib/Horde/Constraint/AlwaysTrue.php --- old/Horde_Constraint-1.0.1/lib/Horde/Constraint/AlwaysTrue.php 1970-01-01 01:00:00.000000000 +0100 +++ new/Horde_Constraint-1.0.1/lib/Horde/Constraint/AlwaysTrue.php 2011-11-22 14:52:46.000000000 +0100 @@ -0,0 +1,13 @@ +<?php +/** + * Always returns true + * + * @author James Pepin <james@jamespepin.com> + */ +class Horde_Constraint_AlwaysTrue implements Horde_Constraint +{ + public function evaluate($value) + { + return true; + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.1/lib/Horde/Constraint/And.php new/Horde_Constraint-1.0.1/lib/Horde/Constraint/And.php --- old/Horde_Constraint-1.0.1/lib/Horde/Constraint/And.php 1970-01-01 01:00:00.000000000 +0100 +++ new/Horde_Constraint-1.0.1/lib/Horde/Constraint/And.php 2011-11-22 14:52:46.000000000 +0100 @@ -0,0 +1,21 @@ +<?php +/** + * Represents a collection of constraints, if one is false, this collection will + * evaluate to false + * + * Based on PHPUnit_Framework_Constraint_And + * + * @author James Pepin <james@jamespepin.com> + */ +class Horde_Constraint_And extends Horde_Constraint_Coupler +{ + public function evaluate($value) + { + foreach ($this->_constraints as $c) { + if (!$c->evaluate($value)) { + return false; + } + } + return true; + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.1/lib/Horde/Constraint/Coupler.php new/Horde_Constraint-1.0.1/lib/Horde/Constraint/Coupler.php --- old/Horde_Constraint-1.0.1/lib/Horde/Constraint/Coupler.php 1970-01-01 01:00:00.000000000 +0100 +++ new/Horde_Constraint-1.0.1/lib/Horde/Constraint/Coupler.php 2011-11-22 14:52:46.000000000 +0100 @@ -0,0 +1,39 @@ +<?php +/** + * Interface for grouped (compound, coupled) constraints. + * + * @author James Pepin <james@jamespepin.com> + */ +abstract class Horde_Constraint_Coupler implements Horde_Constraint +{ + protected $_constraints = array(); + + public function __construct() + { + $constraints = func_get_args(); + foreach ($constraints as $c) { + if (! $c instanceof Horde_Constraint) { + throw new IllegalArgumentException("$c does not implement Horde_Constraint"); + } + $this->addConstraint($c); + } + } + + public function addConstraint(Horde_Constraint $constraint) + { + $kind = get_class($this); + if ($constraint instanceof $kind) { + foreach ($constraint->getConstraints() as $c) { + $this->addConstraint($c); + } + } else { + $this->_constraints[] = $constraint; + } + return $this; + } + + public function getConstraints() + { + return $this->_constraints; + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.1/lib/Horde/Constraint/IsEqual.php new/Horde_Constraint-1.0.1/lib/Horde/Constraint/IsEqual.php --- old/Horde_Constraint-1.0.1/lib/Horde/Constraint/IsEqual.php 1970-01-01 01:00:00.000000000 +0100 +++ new/Horde_Constraint-1.0.1/lib/Horde/Constraint/IsEqual.php 2011-11-22 14:52:46.000000000 +0100 @@ -0,0 +1,22 @@ +<?php +/** + * Checks for equality + * + * Based on PHPUnit_Framework_Constraint_IsEqual + * + * @author James Pepin <james@jamespepin.com> + */ +class Horde_Constraint_IsEqual implements Horde_Constraint +{ + private $_value; + + public function __construct($value) + { + $this->_value = $value; + } + + public function evaluate($value) + { + return $this->_value == $value; + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.1/lib/Horde/Constraint/IsInstanceOf.php new/Horde_Constraint-1.0.1/lib/Horde/Constraint/IsInstanceOf.php --- old/Horde_Constraint-1.0.1/lib/Horde/Constraint/IsInstanceOf.php 1970-01-01 01:00:00.000000000 +0100 +++ new/Horde_Constraint-1.0.1/lib/Horde/Constraint/IsInstanceOf.php 2011-11-22 14:52:46.000000000 +0100 @@ -0,0 +1,22 @@ +<?php +/** + * Checks for an instance of a class + * + * Based on PHPUnit_Framework_Constraint_IsInstanceOf + * + * @author James Pepin <james@jamespepin.com> + */ +class Horde_Constraint_IsInstanceOf implements Horde_Constraint +{ + private $_type; + + public function __construct($type) + { + $this->_type = $type; + } + + public function evaluate($value) + { + return $value instanceof $this->_type; + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.1/lib/Horde/Constraint/Not.php new/Horde_Constraint-1.0.1/lib/Horde/Constraint/Not.php --- old/Horde_Constraint-1.0.1/lib/Horde/Constraint/Not.php 1970-01-01 01:00:00.000000000 +0100 +++ new/Horde_Constraint-1.0.1/lib/Horde/Constraint/Not.php 2011-11-22 14:52:46.000000000 +0100 @@ -0,0 +1,22 @@ +<?php +/** + * Negates another constraint + * + * Based on PHPUnit_Framework_Constraint_Not + * + * @author James Pepin <james@jamespepin.com> + */ +class Horde_Constraint_Not implements Horde_Constraint +{ + private $_constraint; + + public function __construct(Horde_Constraint $constraint) + { + $this->_constraint = $constraint; + } + + public function evaluate($value) + { + return !$this->_constraint->evaluate($value); + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.1/lib/Horde/Constraint/Null.php new/Horde_Constraint-1.0.1/lib/Horde/Constraint/Null.php --- old/Horde_Constraint-1.0.1/lib/Horde/Constraint/Null.php 1970-01-01 01:00:00.000000000 +0100 +++ new/Horde_Constraint-1.0.1/lib/Horde/Constraint/Null.php 2011-11-22 14:52:46.000000000 +0100 @@ -0,0 +1,15 @@ +<?php +/** + * Checks if the value is null + * + * Based on PHPUnit_Framework_Constraint_Null + * + * @author James Pepin <james@jamespepin.com> + */ +class Horde_Constraint_Null implements Horde_Constraint +{ + public function evaluate($value) + { + return is_null($value); + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.1/lib/Horde/Constraint/Or.php new/Horde_Constraint-1.0.1/lib/Horde/Constraint/Or.php --- old/Horde_Constraint-1.0.1/lib/Horde/Constraint/Or.php 1970-01-01 01:00:00.000000000 +0100 +++ new/Horde_Constraint-1.0.1/lib/Horde/Constraint/Or.php 2011-11-22 14:52:46.000000000 +0100 @@ -0,0 +1,19 @@ +<?php +/** + * Represents a collection of constraints, if any are true, the collection will evaluate to true. + * + * @author James Pepin <james@jamespepin.com> + * @author Chuck Hagenbuch <chuck@horde.org> + */ +class Horde_Constraint_Or extends Horde_Constraint_Coupler +{ + public function evaluate($value) + { + foreach ($this->_constraints as $c) { + if ($c->evaluate($value)) { + return true; + } + } + return false; + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.1/lib/Horde/Constraint/PregMatch.php new/Horde_Constraint-1.0.1/lib/Horde/Constraint/PregMatch.php --- old/Horde_Constraint-1.0.1/lib/Horde/Constraint/PregMatch.php 1970-01-01 01:00:00.000000000 +0100 +++ new/Horde_Constraint-1.0.1/lib/Horde/Constraint/PregMatch.php 2011-11-22 14:52:46.000000000 +0100 @@ -0,0 +1,22 @@ +<?php +/** + * Matches against a PCRE regex + * + * Based on PHPUnit_Framework_Constraint_PCREMatch + * + * @author James Pepin <james@jamespepin.com> + */ +class Horde_Constraint_PregMatch implements Horde_Constraint +{ + private $_regex; + + public function __construct($regex) + { + $this->_regex = $regex; + } + + public function evaluate($value) + { + return preg_match($this->_regex, $value) > 0; + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.1/lib/Horde/Constraint.php new/Horde_Constraint-1.0.1/lib/Horde/Constraint.php --- old/Horde_Constraint-1.0.1/lib/Horde/Constraint.php 1970-01-01 01:00:00.000000000 +0100 +++ new/Horde_Constraint-1.0.1/lib/Horde/Constraint.php 2011-11-22 14:52:46.000000000 +0100 @@ -0,0 +1,10 @@ +<?php +/** + * Interface for constraints. + * + * @author James Pepin <james@jamespepin.com> + */ +interface Horde_Constraint +{ + public function evaluate($value); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.1/test/Horde/Constraint/AllTests.php new/Horde_Constraint-1.0.1/test/Horde/Constraint/AllTests.php --- old/Horde_Constraint-1.0.1/test/Horde/Constraint/AllTests.php 1970-01-01 01:00:00.000000000 +0100 +++ new/Horde_Constraint-1.0.1/test/Horde/Constraint/AllTests.php 2011-11-22 14:52:46.000000000 +0100 @@ -0,0 +1,32 @@ +<?php +/** + * @package Constraint + * @subpackage UnitTests + */ + +/** + * Define the main method + */ +if (!defined('PHPUnit_MAIN_METHOD')) { + define('PHPUnit_MAIN_METHOD', 'Horde_Constraint_AllTests::main'); +} + +/** + * Prepare the test setup. + */ +require_once 'Horde/Test/AllTests.php'; +set_include_path(dirname(__FILE__) . '/../../' . PATH_SEPARATOR . get_include_path()); + +/** + * @package Constraint + * @subpackage UnitTests + */ +class Horde_Constraint_AllTests extends Horde_Test_AllTests +{ +} + +Horde_Constraint_AllTests::init('Horde_Constraint', __FILE__); + +if (PHPUnit_MAIN_METHOD == 'Horde_Constraint_AllTests::main') { + Horde_Constraint_AllTests::main(); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.1/test/Horde/Constraint/AlwaysFalseTest.php new/Horde_Constraint-1.0.1/test/Horde/Constraint/AlwaysFalseTest.php --- old/Horde_Constraint-1.0.1/test/Horde/Constraint/AlwaysFalseTest.php 1970-01-01 01:00:00.000000000 +0100 +++ new/Horde_Constraint-1.0.1/test/Horde/Constraint/AlwaysFalseTest.php 2011-11-22 14:52:46.000000000 +0100 @@ -0,0 +1,22 @@ +<?php +class Horde_Constraint_AlwaysFalseTest extends Horde_Test_Case +{ + public static function randomObjectProvider() + { + return array( + array('teststring'), + array(''), + array(true), + array(false), + ); + } + + /** + * @dataProvider randomObjectProvider + */ + public function testEvaluateIsAlwaysFalse($value) + { + $const = new Horde_Constraint_AlwaysFalse(); + $this->assertFalse($const->evaluate($value)); + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.1/test/Horde/Constraint/AlwaysTrueTest.php new/Horde_Constraint-1.0.1/test/Horde/Constraint/AlwaysTrueTest.php --- old/Horde_Constraint-1.0.1/test/Horde/Constraint/AlwaysTrueTest.php 1970-01-01 01:00:00.000000000 +0100 +++ new/Horde_Constraint-1.0.1/test/Horde/Constraint/AlwaysTrueTest.php 2011-11-22 14:52:46.000000000 +0100 @@ -0,0 +1,22 @@ +<?php +class Horde_Constraint_AlwaysTrueTest extends Horde_Test_Case +{ + public static function randomObjectProvider() + { + return array( + array('teststring'), + array(''), + array(true), + array(false), + ); + } + + /** + * @dataProvider randomObjectProvider + */ + public function testEvaluateIsAlwaysTrue($value) + { + $const = new Horde_Constraint_AlwaysTrue(); + $this->assertTrue($const->evaluate($value)); + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.1/test/Horde/Constraint/AndTest.php new/Horde_Constraint-1.0.1/test/Horde/Constraint/AndTest.php --- old/Horde_Constraint-1.0.1/test/Horde/Constraint/AndTest.php 1970-01-01 01:00:00.000000000 +0100 +++ new/Horde_Constraint-1.0.1/test/Horde/Constraint/AndTest.php 2011-11-22 14:52:46.000000000 +0100 @@ -0,0 +1,63 @@ +<?php +class Horde_Constraint_AndTest extends Horde_Test_Case +{ + public function testAndEvaluatesFalseWhenOneConstraintIsFalse() + { + $c1 = new Horde_Constraint_AlwaysTrue(); + $c2 = new Horde_Constraint_AlwaysFalse(); + $and = new Horde_Constraint_And($c1, $c2); + + $this->assertFalse($and->evaluate('test_string')); + } + + public function testAndEvaluatesFalseWhenBothConstraintsAreFalse() + { + $c1 = new Horde_Constraint_AlwaysFalse(); + $c2 = new Horde_Constraint_AlwaysFalse(); + $and = new Horde_Constraint_And($c1, $c2); + + $this->assertFalse($and->evaluate('test_string')); + } + + public function testAndEvaluatesTrueWhenBothConstraintsAreTrue() + { + $c1 = new Horde_Constraint_AlwaysTrue(); + $c2 = new Horde_Constraint_AlwaysTrue(); + $and = new Horde_Constraint_And($c1, $c2); + + $this->assertTrue($and->evaluate('test_string')); + } + + public function testAndEvaluatesFalseWhenFalseConstraintIsAddedViaSetter() + { + $c1 = new Horde_Constraint_AlwaysTrue(); + $c2 = new Horde_Constraint_AlwaysTrue(); + $and = new Horde_Constraint_And($c1, $c2); + + $and->addConstraint(new Horde_Constraint_AlwaysFalse()); + + $this->assertFalse($and->evaluate('test_string')); + } + + public function testAndaddConstraintReturnsAndConstraint() + { + $c1 = new Horde_Constraint_AlwaysTrue(); + $c2 = new Horde_Constraint_AlwaysTrue(); + $and = new Horde_Constraint_And($c1, $c2); + + $returnConst = $and->addConstraint(new Horde_Constraint_AlwaysFalse()); + + $this->assertInstanceOf('Horde_Constraint_And', $returnConst); + } + + public function testReturnedAndEvaluatesFalseWhenFalseConstraintIsAddedViaSetter() + { + $c1 = new Horde_Constraint_AlwaysTrue(); + $c2 = new Horde_Constraint_AlwaysTrue(); + $and = new Horde_Constraint_And($c1, $c2); + + $and = $and->addConstraint(new Horde_Constraint_AlwaysFalse()); + + $this->assertFalse($and->evaluate('test_string')); + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.1/test/Horde/Constraint/IsInstanceOfTest.php new/Horde_Constraint-1.0.1/test/Horde/Constraint/IsInstanceOfTest.php --- old/Horde_Constraint-1.0.1/test/Horde/Constraint/IsInstanceOfTest.php 1970-01-01 01:00:00.000000000 +0100 +++ new/Horde_Constraint-1.0.1/test/Horde/Constraint/IsInstanceOfTest.php 2011-11-22 14:52:46.000000000 +0100 @@ -0,0 +1,19 @@ +<?php +class Horde_Constraint_IsInstanceOfTest extends Horde_Test_Case +{ + public function testConstraintReturnsFalseWhenInstanceIsWrongClass() + { + $foo = new StdClass(); + $const = new Horde_Constraint_IsInstanceOf('FakeClassName'); + + $this->assertFalse($const->evaluate($foo)); + } + + public function testConstraintReturnsTrueWhenInstanceIsCorrectClass() + { + $foo = new StdClass(); + $const = new Horde_Constraint_IsInstanceOf('StdClass'); + + $this->assertTrue($const->evaluate($foo)); + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.1/test/Horde/Constraint/NotTest.php new/Horde_Constraint-1.0.1/test/Horde/Constraint/NotTest.php --- old/Horde_Constraint-1.0.1/test/Horde/Constraint/NotTest.php 1970-01-01 01:00:00.000000000 +0100 +++ new/Horde_Constraint-1.0.1/test/Horde/Constraint/NotTest.php 2011-11-22 14:52:46.000000000 +0100 @@ -0,0 +1,15 @@ +<?php +class Horde_Constraint_NotTest extends Horde_Test_Case +{ + public function testNotMakesFalseConstraintTrue() + { + $not = new Horde_Constraint_Not(new Horde_Constraint_AlwaysFalse()); + $this->assertTrue($not->evaluate('foo')); + } + + public function testNotMakesTrueConstraintFalse() + { + $not = new Horde_Constraint_Not(new Horde_Constraint_AlwaysTrue()); + $this->assertFalse($not->evaluate('foo')); + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.1/test/Horde/Constraint/NullTest.php new/Horde_Constraint-1.0.1/test/Horde/Constraint/NullTest.php --- old/Horde_Constraint-1.0.1/test/Horde/Constraint/NullTest.php 1970-01-01 01:00:00.000000000 +0100 +++ new/Horde_Constraint-1.0.1/test/Horde/Constraint/NullTest.php 2011-11-22 14:52:46.000000000 +0100 @@ -0,0 +1,15 @@ +<?php +class Horde_Constraint_NullTest extends Horde_Test_Case +{ + public function testNullReturnsTrueWhenValueisNull() + { + $const = new Horde_Constraint_Null(); + $this->assertTrue($const->evaluate(null)); + } + + public function testNullReturnsFalseWhenValue_IsNot_Null() + { + $const = new Horde_Constraint_Null(); + $this->assertFalse($const->evaluate('not null value')); + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.1/test/Horde/Constraint/OrTest.php new/Horde_Constraint-1.0.1/test/Horde/Constraint/OrTest.php --- old/Horde_Constraint-1.0.1/test/Horde/Constraint/OrTest.php 1970-01-01 01:00:00.000000000 +0100 +++ new/Horde_Constraint-1.0.1/test/Horde/Constraint/OrTest.php 2011-11-22 14:52:46.000000000 +0100 @@ -0,0 +1,63 @@ +<?php +class Horde_Constraint_OrTest extends Horde_Test_Case +{ + public function testOrEvaluatesTrueWhenOneConstraintIsTrue() + { + $c1 = new Horde_Constraint_AlwaysTrue(); + $c2 = new Horde_Constraint_AlwaysFalse(); + $or = new Horde_Constraint_Or($c1, $c2); + + $this->assertTrue($or->evaluate('test_string')); + } + + public function testOrEvaluatesFalseWhenBothConstraintsAreFalse() + { + $c1 = new Horde_Constraint_AlwaysFalse(); + $c2 = new Horde_Constraint_AlwaysFalse(); + $or = new Horde_Constraint_Or($c1, $c2); + + $this->assertFalse($or->evaluate('test_string')); + } + + public function testOrEvaluatesTrueWhenBothConstraintsAreTrue() + { + $c1 = new Horde_Constraint_AlwaysTrue(); + $c2 = new Horde_Constraint_AlwaysTrue(); + $or = new Horde_Constraint_Or($c1, $c2); + + $this->assertTrue($or->evaluate('test_string')); + } + + public function testOrEvaluatesTrueWhenTrueConstraintIsAddedViaSetter() + { + $c1 = new Horde_Constraint_AlwaysFalse(); + $c2 = new Horde_Constraint_AlwaysFalse(); + $or = new Horde_Constraint_Or($c1, $c2); + + $or->addConstraint(new Horde_Constraint_AlwaysTrue()); + + $this->assertTrue($or->evaluate('test_string')); + } + + public function testOraddConstraintReturnsOrConstraint() + { + $c1 = new Horde_Constraint_AlwaysTrue(); + $c2 = new Horde_Constraint_AlwaysTrue(); + $or = new Horde_Constraint_Or($c1, $c2); + + $returnConst = $or->addConstraint(new Horde_Constraint_AlwaysFalse()); + + $this->assertInstanceOf('Horde_Constraint_Or', $returnConst); + } + + public function testReturnedOrEvaluatesTrueWhenTrueConstraintIsAddedViaSetter() + { + $c1 = new Horde_Constraint_AlwaysFalse(); + $c2 = new Horde_Constraint_AlwaysFalse(); + $or = new Horde_Constraint_Or($c1, $c2); + + $or = $or->addConstraint(new Horde_Constraint_AlwaysTrue()); + + $this->assertTrue($or->evaluate('test_string')); + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Horde_Constraint-1.0.1/test/Horde/Constraint/PregMatchTest.php new/Horde_Constraint-1.0.1/test/Horde/Constraint/PregMatchTest.php --- old/Horde_Constraint-1.0.1/test/Horde/Constraint/PregMatchTest.php 1970-01-01 01:00:00.000000000 +0100 +++ new/Horde_Constraint-1.0.1/test/Horde/Constraint/PregMatchTest.php 2011-11-22 14:52:46.000000000 +0100 @@ -0,0 +1,15 @@ +<?php +class Horde_Constraint_PregMatchTest extends Horde_Test_Case +{ + public function testPregReturnsTrueWhenRegexMatches() + { + $preg = new Horde_Constraint_PregMatch('/somestring/'); + $this->assertTrue($preg->evaluate('somestring')); + } + + public function testPregReturnsFalseWhenRegex_DoesNot_Match() + { + $preg = new Horde_Constraint_PregMatch('/somestring/'); + $this->assertFalse($preg->evaluate('some other string')); + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package.xml new/package.xml --- old/package.xml 2011-04-06 01:06:56.000000000 +0200 +++ new/package.xml 2011-11-22 14:52:46.000000000 +0100 @@ -1,31 +1,32 @@ <?xml version="1.0" encoding="UTF-8"?> -<package packagerversion="1.9.2" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> +<package packagerversion="1.9.4" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> <name>Horde_Constraint</name> <channel>pear.horde.org</channel> <summary>Horde Constraint library</summary> - <description>This package provides a programmatic way of building constraints that evaluate to true or false.</description> + <description>A programmatic way of building constraints that evaluate to true or false.</description> <lead> <name>Chuck Hagenbuch</name> <user>chuck</user> <email>chuck@horde.org</email> <active>yes</active> </lead> - <date>2011-04-06</date> - <time>01:06:56</time> + <date>2011-11-22</date> + <time>14:52:46</time> <version> - <release>1.0.0</release> + <release>1.0.1</release> <api>1.0.0</api> </version> <stability> <release>stable</release> <api>stable</api> </stability> - <license uri="http://opensource.org/licenses/bsd-license.php">BSD</license> + <license uri="http://www.horde.org/licenses/bsd">BSD</license> <notes> -* First stable release for Horde 4. +* [jan] Fix tests to work with PHPUnit 3.6. </notes> <contents> <dir baseinstalldir="/" name="/"> + <file baseinstalldir="/" md5sum="3e601e74c18691c7ed18665510ede17e" name="doc/Horde/Constraint/COPYING" role="doc" /> <file baseinstalldir="/" md5sum="32570005a5df92bcfd4bb192552b23df" name="lib/Horde/Constraint/AlwaysFalse.php" role="php" /> <file baseinstalldir="/" md5sum="9147f23fb1154386b7c9d45e169e13d0" name="lib/Horde/Constraint/AlwaysTrue.php" role="php" /> <file baseinstalldir="/" md5sum="539233a8000ebeedfdde15669a067418" name="lib/Horde/Constraint/And.php" role="php" /> @@ -40,11 +41,11 @@ <file baseinstalldir="/" md5sum="e12bff1991021a2efd2069a9bba032b3" name="test/Horde/Constraint/AllTests.php" role="test" /> <file baseinstalldir="/" md5sum="38fc77e759defa43bfa317ef65e1fc72" name="test/Horde/Constraint/AlwaysFalseTest.php" role="test" /> <file baseinstalldir="/" md5sum="d228afe51ddba9c36d0fba62f6ad3174" name="test/Horde/Constraint/AlwaysTrueTest.php" role="test" /> - <file baseinstalldir="/" md5sum="e4824047b6e1de0ea10cec4f53773c23" name="test/Horde/Constraint/AndTest.php" role="test" /> + <file baseinstalldir="/" md5sum="55247a26f8aefccc66224cde6df47231" name="test/Horde/Constraint/AndTest.php" role="test" /> <file baseinstalldir="/" md5sum="1ca0b371274f87b600e81a8f8ac90f67" name="test/Horde/Constraint/IsInstanceOfTest.php" role="test" /> <file baseinstalldir="/" md5sum="9198c0fd0a79ad880fac728a8d84ccac" name="test/Horde/Constraint/NotTest.php" role="test" /> <file baseinstalldir="/" md5sum="b6b1a9d583711b38831c3058535f5063" name="test/Horde/Constraint/NullTest.php" role="test" /> - <file baseinstalldir="/" md5sum="ba00264ff51c5d27aa91ecd3ffc3a865" name="test/Horde/Constraint/OrTest.php" role="test" /> + <file baseinstalldir="/" md5sum="db9077300fd45c712f729feda26bf604" name="test/Horde/Constraint/OrTest.php" role="test" /> <file baseinstalldir="/" md5sum="bba1572d784015d21b9a881546dd703a" name="test/Horde/Constraint/PregMatchTest.php" role="test" /> </dir> </contents> @@ -60,6 +61,7 @@ </dependencies> <phprelease> <filelist> + <install as="COPYING" name="doc/Horde/Constraint/COPYING" /> <install as="Horde/Constraint.php" name="lib/Horde/Constraint.php" /> <install as="Horde/Constraint/AlwaysFalse.php" name="lib/Horde/Constraint/AlwaysFalse.php" /> <install as="Horde/Constraint/AlwaysTrue.php" name="lib/Horde/Constraint/AlwaysTrue.php" /> @@ -93,7 +95,7 @@ <api>alpha</api> </stability> <date>2011-03-08</date> - <license uri="http://opensource.org/licenses/bsd-license.php">BSD</license> + <license uri="http://www.horde.org/licenses/bsd">BSD</license> <notes> * First alpha release for Horde 4. </notes> @@ -108,7 +110,7 @@ <api>beta</api> </stability> <date>2011-03-16</date> - <license uri="http://opensource.org/licenses/bsd-license.php">BSD</license> + <license uri="http://www.horde.org/licenses/bsd">BSD</license> <notes> * First beta release for Horde 4. </notes> @@ -123,7 +125,7 @@ <api>beta</api> </stability> <date>2011-03-22</date> - <license uri="http://opensource.org/licenses/bsd-license.php">BSD</license> + <license uri="http://www.horde.org/licenses/bsd">BSD</license> <notes> * First release candidate for Horde 4. </notes> @@ -138,7 +140,7 @@ <api>beta</api> </stability> <date>2011-03-29</date> - <license uri="http://opensource.org/licenses/bsd-license.php">BSD</license> + <license uri="http://www.horde.org/licenses/bsd">BSD</license> <notes> * Second release candidate for Horde 4. </notes> @@ -153,10 +155,25 @@ <api>stable</api> </stability> <date>2011-04-06</date> - <license uri="http://opensource.org/licenses/bsd-license.php">BSD</license> + <license uri="http://www.horde.org/licenses/bsd">BSD</license> <notes> * First stable release for Horde 4. </notes> </release> + <release> + <version> + <release>1.0.1</release> + <api>1.0.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <date>2011-11-22</date> + <license uri="http://www.horde.org/licenses/bsd">BSD</license> + <notes> +* [jan] Fix tests to work with PHPUnit 3.6. + </notes> + </release> </changelog> </package> -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org