Bolt\Tests\Storage\StorageTest::testGetContentSortOrderFromContentType PHP Method

testGetContentSortOrderFromContentType() public method

    public function testGetContentSortOrderFromContentType()
    {
        $app = $this->getApp();
        $app['request'] = Request::create('/');
        $db = $this->getDbMockBuilder($app['db'])->setMethods(['fetchAll'])->getMock();
        $app['db'] = $db;
        $db->expects($this->any())->method('fetchAll')->willReturn([]);
        $storage = new StorageMock($app);
        // Test sorting is pulled from contenttype when not specified
        $app['config']->set('contenttypes/entries/sort', '-id');
        $storage->getContent('entries');
        $this->assertSame('ORDER BY "id" DESC', $storage->queries[0]['queries'][0]['order']);
    }