Microweber\tests\DbTest::testShorthandFilters PHP Method

testShorthandFilters() public method

    public function testShorthandFilters()
    {
        $content = db_get('content', 'limit=1&content_type=[eq]page');
        foreach ($content as $item) {
            $this->assertTrue($item['content_type'] == 'page');
        }
        $content = db_get('content', 'limit=1&content_type=[neq]page');
        foreach ($content as $item) {
            $this->assertTrue($item['content_type'] != 'page');
        }
        $content = db_get('content', 'limit=1&content_type=[like]post');
        foreach ($content as $item) {
            $this->assertTrue($item['content_type'] == 'post');
        }
        $content = db_get('content', 'limit=1&content_type=[not_like]post');
        foreach ($content as $item) {
            $this->assertTrue($item['content_type'] != 'post');
        }
    }