【问题标题】:codeception db print resultcodeception db 打印结果
【发布时间】:2018-10-16 23:59:17
【问题描述】:

您好,我正在尝试使用以下方式打印我的结果:

grabFromDatabase('tableNames','column1Name', array('column2Value' => '2'));

我的结果通过但未在控制台中显示实际结果值。非常感谢任何帮助。谢谢

class_name: AcceptanceTester
modules:
    enabled:
        - Asserts

        - Db:
            dsn: "sqlsrv:Server=localhost,1433;Database=Db"
            user: 'username'
            password: 'pwd'
            dump: 'tests/_data/dump.sql'
            populate: true # run populator before all tests
            cleanup: true # run populator before each test
            populator: 'mssql -u $user -h $host $dbname < $dump'
        - \Helper\Acceptance

【问题讨论】:

  • 能够使用 codecept_debug() 打印结果;

标签: php database codeception


【解决方案1】:

不是完全复制和粘贴解决方案,而是可能有帮助的不同想法。您可以考虑执行以下操作:

  /**
     * @return mixed
     */
    public function grabMyStuff()
    {
        $query = "SELECT name FROM tableNames.column1Name WHERE column2Value = '2';
        $this->getModule('Db')->driver->executeQuery($query, [])->fetchAll();
        return $this;
    }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-01-07
    • 1970-01-01
    • 1970-01-01
    • 2019-03-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多