ImboUnitTest\Http\Response\Formatter\XMLTest::testCanFormatGroupsModel PHP Method

testCanFormatGroupsModel() public method

    public function testCanFormatGroupsModel()
    {
        $groups = [['name' => 'group', 'resources' => ['user.get', 'user.head']]];
        $count = count($groups);
        $hits = 2;
        $limit = 5;
        $page = 1;
        $model = $this->getMock('Imbo\\Model\\Groups');
        $model->expects($this->once())->method('getHits')->will($this->returnValue($hits));
        $model->expects($this->once())->method('getPage')->will($this->returnValue($page));
        $model->expects($this->once())->method('getLimit')->will($this->returnValue($limit));
        $model->expects($this->once())->method('getCount')->will($this->returnValue($count));
        $model->expects($this->once())->method('getGroups')->will($this->returnValue($groups));
        $this->assertRegExp('#<imbo>\\s*<search>\\s*<hits>2</hits>\\s*<page>1</page>\\s*<limit>5</limit>\\s*<count>1</count>\\s*</search>\\s*<groups><group>\\s*<name>group</name>\\s*<resources>\\s*<resource>user.get</resource><resource>user.head</resource>\\s*</resources></group></groups>\\s*</imbo>$#', $this->formatter->format($model));
    }