public function getEndpointNameProvider() { $l = Language::createFromArray(['id' => 1, 'name' => 'French']); $ug = UserGroup::createFromArray(['id' => 1, 'name' => 'UserGroup Test']); $s = Site::createFromArray(['id' => 1, 'name' => 'Example Site', 'userGroupId' => 2, 'url' => 'http://example.com', 'languageId' => 3, 'updatedAt' => '1984-06-01 07:32:23', 'isArchived' => true]); // instance, name, expected return [[$l, null, 'languages'], [$ug, null, 'usergroups'], [$s, null, 'sites'], [$s, 'customname', 'customname']]; }
/** * @dataProvider isAllowedMethodProvider */ public function testIsAllowedMethod($method, $expected) { $id = 1; $name = 'Libcaca'; $s = new Site(); $s->setId($id); $s->setName($name); $this->assertEquals($expected, $s->isAllowedMethod($method)); }