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