错误:断言两个字符串相等的失败 [英] Error:Failed asserting that two strings are equal

查看:299
本文介绍了错误:断言两个字符串相等的失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

安装xmlps软件。安装完成。当我尝试测试时,使用这个./unittest.sh命令。

我得到下面提到的错误。

************* ************************************************** **************

root @ gains [/ home / quotequadsco / pkp / xmlps]#。/ unittest.sh

PHPUnit 3.7.29 by Sebastian Bergmann。



配置读自/home/quotequadsco/pkp/xmlps/phpunit.xml



................. F



时间:3.86秒,内存:42.25Mb



有1次失败:



1)ApiTest \ Controller \ ApiControllerTest :: testSubmitAction

无法断言两个字符串相同。

---预期

+++实际

@@ @@

-error

+成功



/ home / quotequadsco / pkp / xmlps / module / Api / test / ApiTest /Controller/JobControllerTest.php:63



失败!

测试:18,断言:56,失败:1。



******************************************** *********************************



JobControllerTest .php



Am installing xmlps software. Installation is done. When I try test, using this ./unittest.sh command.
Am getting a mentioned below error.
*****************************************************************************
root@gains [/home/quotequadsco/pkp/xmlps]# ./unittest.sh
PHPUnit 3.7.29 by Sebastian Bergmann.

Configuration read from /home/quotequadsco/pkp/xmlps/phpunit.xml

.................F

Time: 3.86 seconds, Memory: 42.25Mb

There was 1 failure:

1) ApiTest\Controller\ApiControllerTest::testSubmitAction
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-error
+success

/home/quotequadsco/pkp/xmlps/module/Api/test/ApiTest/Controller/JobControllerTest.php:63

FAILURES!
Tests: 18, Assertions: 56, Failures: 1.

*****************************************************************************

JobControllerTest.php

<?php

namespace ApiTest\Controller;

use Api\Entity\Job;
use Xmlps\UnitTest\ControllerTest;

class ApiControllerTest extends ControllerTest
{
    protected $document;
    protected $job;
    protected $user;

    protected $testFile = '/tmp/UNITTEST_document.txt';

    protected $citationStyles;

    /**
     * Set up the controller test
     *
     * @return void
     */
    public function setUp()
    {
        parent::setUp();

        $this->citationStyles = $this->sm->get('CitationstyleConversion\Model\Citationstyles');

        $this->resetTestData();
    }

    /**
     * Test if the submit action canot be accessed by guests
     *
     * @return void
     */
    public function testSubmitActionCannotBeAccessedLoggedOut()
    {
        $this->dispatch($this->buildQuery('submit', array(), false));
        $this->assertResponseStatusCode(403);
    }

    /**
     * Test if a job can be submitted
     *
     * @return void
     */
    public function testSubmitAction()
    {
        $styleMap = $this->citationStyles->getStyleMap();
        $keys = array_keys($styleMap);

        $data = array(
            'fileName' => 'Testfile.txt',
            'fileContent' => base64_encode('Test Content'),
            'citationStyleHash' => $keys[0],
        );

        $this->dispatch($this->buildQuery('submit', $data));
        $this->assertResponseStatusCode(200);
        $response = json_decode($this->getResponse()->getContent());
        $this->assertTrue(is_object($response));
        $this->assertSame($response->status, 'success');
        $this->assertNotEmpty($response->id);
    }







如何修复此错误。我搜索了很多,但dint得到任何东西。




How to fix this error. I searched a lot but dint get anything.

推荐答案

文件;
protected
document; protected


job ;
protected
job; protected


user ;

受保护
user; protected


这篇关于错误:断言两个字符串相等的失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆