Skip to content

Commit

Permalink
Fix failing serialization tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ndiritu committed May 23, 2022
1 parent e940f35 commit 569fe8e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 27 deletions.
5 changes: 4 additions & 1 deletion serialization/php/json/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
"repositories": [
{
"type": "path",
"url": "../../../abstractions/php"
"url": "../../../abstractions/php",
"options": {
"symlink": false
}
}
],
"autoload": {
Expand Down
11 changes: 0 additions & 11 deletions serialization/php/json/tests/JsonParseNodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use GuzzleHttp\Psr7\Utils;
use Microsoft\Kiota\Abstractions\Enum;
use Microsoft\Kiota\Abstractions\Serialization\ParseNode;
use Microsoft\Kiota\Abstractions\Types\Byte;
use Microsoft\Kiota\Abstractions\Types\Date;
use Microsoft\Kiota\Abstractions\Types\Time;
use Microsoft\Kiota\Serialization\Json\JsonParseNode;
Expand Down Expand Up @@ -95,16 +94,6 @@ public function testGetAnyValue(): void {
$this->assertEquals('Silas Kenneth', $expectedString);
}

public function testGetByteValue(): void {
$this->parseNode = new JsonParseNode('23');
$expected = $this->parseNode->getByteValue();
$this->assertInstanceOf(Byte::class, $expected);
$this->assertEquals(23, (string)$expected);
$this->expectException(Exception::class);
$this->parseNode = new JsonParseNode('-192');
$this->parseNode->getByteValue();
}

public function testGetEnumValue(): void {
$this->parseNode = new JsonParseNode('married');
/** @var Enum $expected */
Expand Down
18 changes: 3 additions & 15 deletions serialization/php/json/tests/JsonSerializationWriterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Microsoft\Kiota\Serialization\Tests;

use Microsoft\Kiota\Abstractions\Serialization\SerializationWriter;
use Microsoft\Kiota\Abstractions\Types\Byte;
use Microsoft\Kiota\Abstractions\Types\Date;
use Microsoft\Kiota\Abstractions\Types\Time;
use Microsoft\Kiota\Serialization\Json\JsonSerializationWriter;
Expand Down Expand Up @@ -135,9 +134,9 @@ public function testWriteEnumValue(): void{

public function testWriteAnyValue(): void {
$this->jsonSerializationWriter = new JsonSerializationWriter();
$byte = new Byte(23);
$this->jsonSerializationWriter->writeAnyValue("to", $byte);
$expected = '"to":23';
$time = new Time('11:00:00');
$this->jsonSerializationWriter->writeAnyValue("created", $time);
$expected = '"created":"11:00:00"';
$actual = $this->jsonSerializationWriter->getSerializedContent()->getContents();
$this->assertEquals($expected, $actual);
}
Expand Down Expand Up @@ -198,17 +197,6 @@ public function testGetSerializedContent(): void{
$this->assertEquals($expected, $actual);
}

/**
*/
public function testWriteByteValue(): void{
$this->jsonSerializationWriter = new JsonSerializationWriter();
$byte = new Byte(23);
$this->jsonSerializationWriter->writeAnyValue("to", $byte);
$expected = '"to":23';
$actual = $this->jsonSerializationWriter->getSerializedContent()->getContents();
$this->assertEquals($expected, $actual);
}

/**
*/
public function testWriteStringValue(): void {
Expand Down

0 comments on commit 569fe8e

Please sign in to comment.