assertSame("42", $dbo->getString()); } public function testInt() { $dbo = LuStringDbo::jsonDeserialize(42); $this->assertSame("42", $dbo->getString()); } public function testIntNegativeString() { $dbo = LuStringDbo::jsonDeserialize("-42"); $this->assertSame("-42", $dbo->getString()); } public function testIntNegative() { $dbo = LuStringDbo::jsonDeserialize(-42); $this->assertSame("-42", $dbo->getString()); } public function testStringIntPlusData() { $dbo = LuStringDbo::jsonDeserialize("42test"); $this->assertSame("42test", $dbo->getString()); } public function testFloat() { $dbo = LuStringDbo::jsonDeserialize(42.42); $this->assertSame("42.42", $dbo->getString()); } public function testFloatString() { $dbo = LuStringDbo::jsonDeserialize("42.42"); $this->assertSame("42.42", $dbo->getString()); } public function testExponentialString() { $dbo = LuStringDbo::jsonDeserialize("42e+01"); $this->assertSame("42e+01", $dbo->getString()); } public function testBool() { $this->expectException(AbortException::class); LuStringDbo::jsonDeserialize(true); } public function testBoolString() { $dbo = LuStringDbo::jsonDeserialize("true"); $this->assertSame("true", $dbo->getString()); } public function testArrayEmpty() { $this->expectException(AbortException::class); LuStringDbo::jsonDeserialize([]); } public function testArrayString() { $this->expectException(AbortException::class); LuStringDbo::jsonDeserialize(["42"]); } public function testArrayInt() { $this->expectException(AbortException::class); LuStringDbo::jsonDeserialize([42]); } public function testArrayFloat() { $this->expectException(AbortException::class); LuStringDbo::jsonDeserialize([42.42]); } public function testNull() { $this->expectException(AbortException::class); LuStringDbo::jsonDeserialize(null); } public function testObject() { $this->expectException(AbortException::class); LuStringDbo::jsonDeserialize(new self()); } }