在构建MailThiefFiveFourCompatible时,目标不可实例化(Laravel 5.1到5.4)

时间:2017-09-07 10:33:39

标签: phpunit laravel-5.4

我正在将Laravel 5.1应用升级到Laravel 5.5,并且一直在关注升级指南。

在从5.3升级到5.4的同时,我遇到了使用MailThief InteractsWithMail特征的单元测试失败的问题。

composer.json:

{
  "name": "laravel/laravel",
  "description": "The Laravel Framework.",
  "keywords": [
    "framework",
    "laravel"
  ],
  "license": "MIT",
  "type": "project",
  "require": {
    "php": ">=7",
    "laravel/framework": "5.4.*",
    "laravelcollective/html": "5.4.*",
    "jeremykendall/php-domain-parser": "^3.0",
    "laracasts/flash": "^2.0",
    "aws/aws-sdk-php": "^3.21",
    "league/flysystem-aws-s3-v3": "~1.0",
    "maatwebsite/excel": "^2.1",
    "league/oauth2-client": "1.4.*",
    "microsoft/microsoft-graph": "^0.1.1",
    "guzzlehttp/guzzle": "^6.2",
    "dusterio/laravel-aws-worker": "^0.1.9",
    "zizaco/entrust": "5.2.x-dev",
    "anchu/ftp": "^2.0",
    "predis/predis": "~1.0"
  },
  "require-dev": {
    "fzaninotto/faker": "~1.4",
    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "~6",
    "phpspec/phpspec": "~2.1",
    "laravel/homestead": "^4.0",
    "tightenco/mailthief": ">=0.3.8",
    "barryvdh/laravel-ide-helper": "*",
    "doctrine/dbal": "^2.5",
    "symfony/dom-crawler": "~3.1",
    "symfony/css-selector": "~3.1",
    "laravel/browser-kit-testing": "^2.0"
  },
  "autoload": {
    "classmap": [
      "database"
    ],
    "psr-4": {
      "App\\": "app/"
    },
    "files": [
      "app/Support/Helpers.php"
    ]
  },
  "autoload-dev": {
    "classmap": [
      "tests/TestCase.php"
    ],
    "psr-4": {
      "Tests\\": "tests/"
    }
  },
  "scripts": {
    "post-root-package-install": [
      "php -r \"copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
      "php artisan key:generate"
    ],
    "post-install-cmd": [
      "Illuminate\\Foundation\\ComposerScripts::postInstall",
      "php artisan optimize"
    ],
    "post-update-cmd": [
      "Illuminate\\Foundation\\ComposerScripts::postUpdate",
      "php artisan ide-helper:generate -M",
      "php artisan ide-helper:meta",
      "php artisan optimize"
    ]
  },
  "config": {
    "preferred-install": "dist"
  }
}

单元测试堆栈跟踪:

Target [Illuminate\Contracts\View\Factory] is not instantiable while building [MailThief\MailThiefFiveFourCompatible].
 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php:895
 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php:735
 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php:608
 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php:575
 /app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:728
 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php:862
 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php:790
 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php:756
 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php:608
 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php:575
 /app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:728
 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php:1172
 /app/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:159
 /app/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:128
 /app/vendor/tightenco/mailthief/src/Testing/InteractsWithMail.php:21
 /app/vendor/tightenco/mailthief/src/Testing/InteractsWithMail.php:59

我正在使用Windows 10上托管的Homestead。

0 个答案:

没有答案