public function testSetObjectObject() { $obj_binaryTree = new BinaryTree('content'); $obj_binaryTree->setObject(null); $this->assertFalse($obj_binaryTree->isEmpty(), 'Binary tree should not be empty.'); $this->assertEquals('content', $obj_binaryTree->getObject(), 'Binary tree\'s object should equal content.'); $this->assertNotNull($obj_binaryTree->getLeftTree(), 'Left tree should not be null.'); $this->assertTrue($obj_binaryTree->getLeftTree()->isEmpty(), 'Left tree should be empty.'); $this->assertNotNull($obj_binaryTree->getRightTree(), 'Right tree should not be null.'); $this->assertTrue($obj_binaryTree->getRightTree()->isEmpty(), 'Right tree should be empty.'); $obj_binaryTreeEmpty = new BinaryTree(); $obj_binaryTreeEmpty->setObject('content'); $this->assertFalse($obj_binaryTreeEmpty->isEmpty(), 'Binary tree should not be empty.'); $this->assertEquals('content', $obj_binaryTreeEmpty->getObject(), 'Binary tree\'s object should equal content.'); $this->assertNotNull($obj_binaryTreeEmpty->getLeftTree(), 'Left tree should not be null.'); $this->assertTrue($obj_binaryTreeEmpty->getLeftTree()->isEmpty(), 'Left tree should be empty.'); $this->assertNotNull($obj_binaryTreeEmpty->getRightTree(), 'Right tree should not be null.'); $this->assertTrue($obj_binaryTreeEmpty->getRightTree()->isEmpty(), 'Right tree should be empty.'); }