public function testConstructorShouldSetIdentifierItemsAndLabelWhenPassed() { $items = array(array('id' => 1, 'title' => 'Foo', 'email' => 'foo@bar'), array('id' => 2, 'title' => 'Bar', 'email' => 'bar@bar'), array('id' => 3, 'title' => 'Baz', 'email' => 'baz@bar')); $data = new DojoData('id', $items, 'title'); $this->assertEquals('id', $data->getIdentifier()); $this->assertEquals('title', $data->getLabel()); foreach ($items as $item) { $this->assertTrue($data->hasItem($item['id'])); } }