public function isSubset(Set $B) : bool { $B_array = $B->asArray(); $A∩B = array_intersect_key($this->A, $B_array); $A∖B = array_diff_key($this->A, $B_array); return count($A∩B) === count($this->A) && empty($A∖B); }
/** * @dataProvider dataProviderForIsNotSubset */ public function testIsNotSubset(array $A, array $B) { $setA = new Set($A); $setB = new Set($B); $this->assertFalse($setA->isSubset($setB)); }