Skip to content

Commit

Permalink
Add backslash to TXT encode/decode testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Pike committed Aug 10, 2017
1 parent 1d8461c commit f223806
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/DNSContentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function testEncodeSoa() {
}
public function testEncodeTxt() {
// TXT should be escaped and quoted
$this->assertEquals('"hello \"world\""', DNSContent::encode('hello "world"', 'TXT', 'example.com.'));
$this->assertEquals('"hello \"world\" \\\\"', DNSContent::encode('hello "world" \\', 'TXT', 'example.com.'));
}
public function testEncodeMx() {
// MX hostname should be canonified
Expand All @@ -41,7 +41,7 @@ public function testEncodeA() {

public function testDecodeTxt() {
// TXT should be unquoted and unescaped
$this->assertEquals('hello "world"', DNSContent::decode('"hello \"world\""', 'TXT', 'example.com.'));
$this->assertEquals('hello "world" \\', DNSContent::decode('"hello \"world\" \\\\"', 'TXT', 'example.com.'));
}
public function testDecodeMx() {
// MX hostname should be abbreviated
Expand Down Expand Up @@ -79,7 +79,7 @@ public function testBind9FormatSoa() {
}
public function testBind9FormatTxt() {
// TXT records should be untouched (assumes already encoded)
$this->assertEquals('"hello \"world\""', DNSContent::bind9_format('"hello \"world\""', 'TXT', 'example.com.'));
$this->assertEquals('"hello \"world\" \\\\"', DNSContent::bind9_format('"hello \"world\" \\\\"', 'TXT', 'example.com.'));
}
public function testBind9FormatA() {
// A records should be untouched
Expand Down

0 comments on commit f223806

Please sign in to comment.