我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

Laravel如何存根视图渲染

I'm trying to do controller testing with laravel 4.1 without touching the database. So im using the repository pattern and I mock the repositories and make them return dummy model objetcs/dummy model collections.

The problem is, the view is trying to use the models relationships etc... And it fails because relationships can't work as the database is empty.

Is there a way to bypass the view rendering as rails do ?

Read about testing environment and mocking in Laravel

近期文章

  • 如何隐藏某些用户的某些网页或链接?
  • cakephp使用saveAll保存多个hasmany相关模型
  • 导致脚本在php中停止的函数
  • 如何将多个子目录指向根Web目录
  • Wordpress WooCommerce - 在电子邮件中添加订单详细信息
  • 不用ajax在php中更新数据库
  • 无法捕获PHP套接字连接:: 504网关超时的响应
  • 添加产品webservice prestashop时出错500
  • CodeIgniter + Bootstrap集成[关闭]
  • 致命错误:不能使用MongoCursor类型的对象作为数组
  • 解决同一网页上两个简单表单之间的冲突
  • 如何将www.example.com/posts/123转换为example.com/posts/123?
  • 在PHP的某些条件下创建一个唯一的数组
  • 检查工作时间 - 改进代码/逻辑
  • 从mysql获取Xcode中的显示值错误?
  • 从父脚本访问包含文件中定义的数组
  • Laravel:急切加载数据透视表并在数据透视表字段上排序
  • PHP中SELECT SELECT的问题
  • 在PHP中将文件存入嵌套数组
  • Symfony2 Monolog在控制器中进行通道

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华