public function testWithout() { $included_nodes = [KademliaTestFactory::constructNode(), KademliaTestFactory::constructNode(), KademliaTestFactory::constructNode(), KademliaTestFactory::constructNode()]; $excluded_nodes = [KademliaTestFactory::constructNode(), KademliaTestFactory::constructNode(), KademliaTestFactory::constructNode()]; $intersection_nodes = [KademliaTestFactory::constructNode(), KademliaTestFactory::constructNode()]; $node_list_a = new Kademlia\NodeList(array_merge($included_nodes, $intersection_nodes)); $node_list_b = new Kademlia\NodeList(array_merge($excluded_nodes, $intersection_nodes)); $without = $node_list_a->without($node_list_b); $actual_count = count($without->toArray()); $expected_count = count($included_nodes); $this->assertEqual($actual_count, $expected_count); }