public function testGroups() { $groupsObject = new GroupsObject(); $this->assertEquals($this->getContent('groups_all'), $this->serializer->serialize($groupsObject, $this->getFormat())); $this->serializer->setGroups(array("foo")); $this->assertEquals($this->getContent('groups_foo'), $this->serializer->serialize($groupsObject, $this->getFormat())); $this->serializer->setGroups(array("foo", "bar")); $this->assertEquals($this->getContent('groups_foobar'), $this->serializer->serialize($groupsObject, $this->getFormat())); $this->serializer->setGroups(null); $this->assertEquals($this->getContent('groups_all'), $this->serializer->serialize($groupsObject, $this->getFormat())); $this->serializer->setGroups(array()); $this->assertEquals($this->getContent('groups_all'), $this->serializer->serialize($groupsObject, $this->getFormat())); $this->serializer->setGroups(array('Default')); $this->assertEquals($this->getContent('groups_default'), $this->serializer->serialize($groupsObject, $this->getFormat())); }