/** * @param MyNode $needle * @param MyNode[] $haystack */ private function assertContainsMyNode(MyNode $needle, array $haystack) { foreach ($haystack as $node) { if ($needle->getID() === $node->getID()) { return; } } $this->fail('Failed asserting that the array ' . print_r($haystack, true) . 'contains the specified node ' . print_r($needle, true)); }
/** * @dataProvider validPointProvider */ public function testShouldGenerateAnID($x, $y) { $expectedID = $x . 'x' . $y; $sut = new MyNode($x, $y); $this->assertSame($expectedID, $sut->getID()); }