Skip to content

Commit da5601c

Browse files
committed
Improve test suite
1 parent d77fe86 commit da5601c

File tree

3 files changed

+40
-38
lines changed

3 files changed

+40
-38
lines changed

src/InnerListTest.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -162,22 +162,4 @@ public function it_successfully_parse_a_http_field(): void
162162
self::assertSame(42.0, $instance->get(2)->value);
163163
self::assertInstanceOf(Token::class, $instance->get(2)->parameters->value('john'));
164164
}
165-
166-
/**
167-
* @test
168-
*/
169-
public function it_fails_to_parse_an_invalid_http_field(): void
170-
{
171-
$this->expectException(SyntaxError::class);
172-
InnerList::fromHttpValue('("hello)world" 42 42.0;john=doe);foo="bar(" toto');
173-
}
174-
175-
/**
176-
* @test
177-
*/
178-
public function it_fails_to_parse_an_invalid_http_field_2(): void
179-
{
180-
$this->expectException(SyntaxError::class);
181-
InnerList::fromHttpValue('"hello)world" 42 42.0;john=doe);foo="bar("');
182-
}
183165
}

src/OrderedListTest.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -144,24 +144,4 @@ public function test_it_can_generate_the_same_value(): void
144144

145145
self::assertSame($res->toHttpValue(), $list->toHttpValue());
146146
}
147-
148-
/**
149-
* @test
150-
*/
151-
public function it_fails_to_parse_invalid_string_1(): void
152-
{
153-
$this->expectException(SyntaxError::class);
154-
155-
OrderedList::fromHttpValue('(foo;number="hello\")');
156-
}
157-
158-
/**
159-
* @test
160-
*/
161-
public function it_fails_to_parse_invalid_string_2(): void
162-
{
163-
$this->expectException(SyntaxError::class);
164-
165-
Dictionary::fromHttpValue('number="hell\o"');
166-
}
167147
}

src/ParserTest.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,44 @@ public function it_will_fail_with_wrong_string_utf8(): void
6262

6363
Parser::parseDictionary('a="foébar"');
6464
}
65+
66+
/**
67+
* @test
68+
*/
69+
public function it_fails_to_parse_invalid_string_1(): void
70+
{
71+
$this->expectException(SyntaxError::class);
72+
73+
Parser::parseList('(foo;number="hello\")');
74+
}
75+
76+
/**
77+
* @test
78+
*/
79+
public function it_fails_to_parse_invalid_string_2(): void
80+
{
81+
$this->expectException(SyntaxError::class);
82+
83+
Parser::parseDictionary('number="hell\o"');
84+
}
85+
86+
/**
87+
* @test
88+
*/
89+
public function it_fails_to_parse_an_invalid_http_field(): void
90+
{
91+
$this->expectException(SyntaxError::class);
92+
93+
Parser::parseInnerList('("hello)world" 42 42.0;john=doe);foo="bar(" toto');
94+
}
95+
96+
/**
97+
* @test
98+
*/
99+
public function it_fails_to_parse_an_invalid_http_field_2(): void
100+
{
101+
$this->expectException(SyntaxError::class);
102+
103+
Parser::parseInnerList('"hello)world" 42 42.0;john=doe);foo="bar("');
104+
}
65105
}

0 commit comments

Comments
 (0)