public function testIncrementDecrementCurrentDepth() { $maxDepth = 3; $this->instance->setDepth($maxDepth); $this->assertEquals($maxDepth, $this->instance->getDepth()); $this->assertEquals(1, $this->instance->getCurrentDepth()); $this->assertTrue($this->instance->incrementCurrentDepth() instanceof Serializer); $this->assertTrue($this->instance->isWithinBounds()); $this->assertTrue($this->instance->incrementCurrentDepth() instanceof Serializer); $this->assertEquals($maxDepth, $this->instance->getCurrentDepth()); $this->assertTrue($this->instance->isWithinBounds()); $this->assertTrue($this->instance->incrementCurrentDepth() instanceof Serializer); $this->assertFalse($this->instance->isWithinBounds()); $this->assertTrue($this->instance->decrementCurrentDepth() instanceof Serializer); $this->assertTrue($this->instance->isWithinBounds()); $this->instance->resetCurrentDepth(); $this->assertNotEquals($maxDepth, $this->instance->getCurrentDepth()); }