1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222
|
Description: Adapt to PHPUnit 8.x and 9.x API.
Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
--- a/Horde_Date_Parser-2.0.7/test/Horde/Date/Parser/HandlerTest.php
+++ /dev/null
@@ -1,132 +0,0 @@
-<?php
-/**
- * @category Horde
- * @package Date
- * @subpackage UnitTests
- */
-
-/**
- * @category Horde
- * @package Date
- * @subpackage UnitTests
- */
-class Horde_Date_Parser_HandlerTest extends Horde_Test_Case
-{
- public function setUp()
- {
- // Wed Aug 16 14:00:00 UTC 2006
- $this->now = new Horde_Date('2006-08-16 14:00:00');
- }
-
- public function testHandlerClass1()
- {
- /*
- $handler = Chronic::Handler.new([:repeater], :handler)
-
- tokens = [Chronic::Token.new('friday')]
- tokens[0].tag(Chronic::RepeaterDayName.new(:friday))
-
- assert handler.match(tokens, Chronic.definitions)
-
- tokens << Chronic::Token.new('afternoon')
- tokens[1].tag(Chronic::RepeaterDayPortion.new(:afternoon))
-
- assert !handler.match(tokens, Chronic.definitions)
- */
- }
-
- public function testHandlerClass2()
- {
- /*
- handler = Chronic::Handler.new([:repeater, :repeater?], :handler)
-
- tokens = [Chronic::Token.new('friday')]
- tokens[0].tag(Chronic::RepeaterDayName.new(:friday))
-
- assert handler.match(tokens, Chronic.definitions)
-
- tokens << Chronic::Token.new('afternoon')
- tokens[1].tag(Chronic::RepeaterDayPortion.new(:afternoon))
-
- assert handler.match(tokens, Chronic.definitions)
-
- tokens << Chronic::Token.new('afternoon')
- tokens[2].tag(Chronic::RepeaterDayPortion.new(:afternoon))
-
- assert !handler.match(tokens, Chronic.definitions)
- */
- }
-
- public function testHandlerClass3()
- {
- /*
- handler = Chronic::Handler.new([:repeater, 'time?'], :handler)
-
- tokens = [Chronic::Token.new('friday')]
- tokens[0].tag(Chronic::RepeaterDayName.new(:friday))
-
- assert handler.match(tokens, Chronic.definitions)
-
- tokens << Chronic::Token.new('afternoon')
- tokens[1].tag(Chronic::RepeaterDayPortion.new(:afternoon))
-
- assert !handler.match(tokens, Chronic.definitions)
- */
- }
-
- public function testHandlerClass4()
- {
- /*
- handler = Chronic::Handler.new([:repeater_month_name, :scalar_day, 'time?'], :handler)
-
- tokens = [Chronic::Token.new('may')]
- tokens[0].tag(Chronic::RepeaterMonthName.new(:may))
-
- assert !handler.match(tokens, Chronic.definitions)
-
- tokens << Chronic::Token.new('27')
- tokens[1].tag(Chronic::ScalarDay.new(27))
-
- assert handler.match(tokens, Chronic.definitions)
- */
- }
-
- public function testHandlerClass5()
- {
- /*
- handler = Chronic::Handler.new([:repeater, 'time?'], :handler)
-
- tokens = [Chronic::Token.new('friday')]
- tokens[0].tag(Chronic::RepeaterDayName.new(:friday))
-
- assert handler.match(tokens, Chronic.definitions)
-
- tokens << Chronic::Token.new('5:00')
- tokens[1].tag(Chronic::RepeaterTime.new('5:00'))
-
- assert handler.match(tokens, Chronic.definitions)
-
- tokens << Chronic::Token.new('pm')
- tokens[2].tag(Chronic::RepeaterDayPortion.new(:pm))
-
- assert handler.match(tokens, Chronic.definitions)
- */
- }
-
- public function testHandlerClass6()
- {
- /*
- handler = Chronic::Handler.new([:scalar, :repeater, :pointer], :handler)
-
- tokens = [Chronic::Token.new('3'),
- Chronic::Token.new('years'),
- Chronic::Token.new('past')]
-
- tokens[0].tag(Chronic::Scalar.new(3))
- tokens[1].tag(Chronic::RepeaterYear.new(:year))
- tokens[2].tag(Chronic::Pointer.new(:past))
-
- assert handler.match(tokens, Chronic.definitions)
- */
- }
-}
--- a/Horde_Date_Parser-2.0.7/test/Horde/Date/Parser/Locale/BaseTest.php
+++ b/Horde_Date_Parser-2.0.7/test/Horde/Date/Parser/Locale/BaseTest.php
@@ -25,7 +25,7 @@
/**
* Wed Aug 16 14:00:00 UTC 2006
*/
- public function setUp()
+ public function setUp(): void
{
$this->now = new Horde_Date('2006-08-16 14:00:00');
$this->parser = Horde_Date_Parser::factory(array('now' => $this->now));
@@ -721,6 +721,7 @@
public function testArgumentValidation()
{
+ $this->expectNotToPerformAssertions();
try {
$this->parser->parse('may 27', array('foo' => 'bar'));
$this->fail("Should throw InvalidArgumentException");
--- a/Horde_Date_Parser-2.0.7/test/Horde/Date/Parser/Locale/DeTest.php
+++ b/Horde_Date_Parser-2.0.7/test/Horde/Date/Parser/Locale/DeTest.php
@@ -15,7 +15,7 @@
/**
* Wed Aug 16 14:00:00 UTC 2006
*/
- public function setUp()
+ public function setUp(): void
{
$this->now = new Horde_Date('2006-08-16 14:00:00');
$this->parser = Horde_Date_Parser::factory(array('locale' => 'de', 'now' => $this->now));
--- a/Horde_Date_Parser-2.0.7/test/Horde/Date/Parser/ParserTest.php
+++ b/Horde_Date_Parser-2.0.7/test/Horde/Date/Parser/ParserTest.php
@@ -12,7 +12,7 @@
*/
class Horde_Date_Parser_ParserTest extends Horde_Test_Case
{
- public function setUp()
+ public function setUp(): void
{
// Wed Aug 16 14:00:00 UTC 2006
$this->now = new Horde_Date('2006-08-16 14:00:00');
--- a/Horde_Date_Parser-2.0.7/test/Horde/Date/Parser/TokenTest.php
+++ b/Horde_Date_Parser-2.0.7/test/Horde/Date/Parser/TokenTest.php
@@ -22,15 +22,15 @@
$token->tag('foo', 'mytag');
$this->assertEquals(1, count($token->tags));
$this->assertTrue($token->tagged());
- $this->assertInternalType('string', $token->getTag('foo'));
+ $this->assertIsString($token->getTag('foo'));
$token->tag('bar', 5);
$this->assertEquals(2, count($token->tags));
- $this->assertInternalType('int', $token->getTag('bar'));
+ $this->assertIsInt($token->getTag('bar'));
$token->untag('foo');
$this->assertEquals(1, count($token->tags));
- $this->assertInternalType('int', $token->getTag('bar'));
+ $this->assertIsInt($token->getTag('bar'));
}
public function testScanForDayNames()
--- /dev/null
+++ b/Horde_Date_Parser-2.0.7/test/Horde/Date/Parser/phpunit.xml
@@ -0,0 +1 @@
+<phpunit bootstrap="bootstrap.php"></phpunit>
--- a/package.xml
+++ b/package.xml
@@ -69,7 +69,6 @@
<file baseinstalldir="/" md5sum="0defe275aee10c7a8c878fe4a976804e" name="test/Horde/Date/Parser/Locale/DeTest.php" role="test" />
<file baseinstalldir="/" md5sum="8bc9518b9c0576806c82d9413489d099" name="test/Horde/Date/Parser/AllTests.php" role="test" />
<file baseinstalldir="/" md5sum="0a5018f0726d4673850fece3ad4d72c0" name="test/Horde/Date/Parser/bootstrap.php" role="test" />
- <file baseinstalldir="/" md5sum="d7033f6636d67413dd7db006a4489856" name="test/Horde/Date/Parser/HandlerTest.php" role="test" />
<file baseinstalldir="/" md5sum="582665fdb4fcde93010503be8f91b6aa" name="test/Horde/Date/Parser/ParserTest.php" role="test" />
<file baseinstalldir="/" md5sum="507a4f085ac742d7708b6e1620beddd0" name="test/Horde/Date/Parser/ResultTest.php" role="test" />
<file baseinstalldir="/" md5sum="c28911f21251c3c051dc090ba4479a12" name="test/Horde/Date/Parser/TokenTest.php" role="test" />
@@ -154,7 +153,6 @@
<install as="Horde/Date/Parser/Locale/Pt/Timezone.php" name="lib/Horde/Date/Parser/Locale/Pt/Timezone.php" />
<install as="Horde/Date/Parser/AllTests.php" name="test/Horde/Date/Parser/AllTests.php" />
<install as="Horde/Date/Parser/bootstrap.php" name="test/Horde/Date/Parser/bootstrap.php" />
- <install as="Horde/Date/Parser/HandlerTest.php" name="test/Horde/Date/Parser/HandlerTest.php" />
<install as="Horde/Date/Parser/ParserTest.php" name="test/Horde/Date/Parser/ParserTest.php" />
<install as="Horde/Date/Parser/ResultTest.php" name="test/Horde/Date/Parser/ResultTest.php" />
<install as="Horde/Date/Parser/TokenTest.php" name="test/Horde/Date/Parser/TokenTest.php" />
|