zoukankan      html  css  js  c++  java
  • laravel架构

    1、Laravel 5.1 中的异常处理器和HTTP异常处理实例教程

    http://laravelacademy.org/post/1867.html

    2、laravel 集成sentry,sentry通知用slack

    https://api.slack.com/incoming-webhooks#getting-started

    3、Laravel 模型事件入门

    https://laravel-china.org/topics/9037/an-introduction-to-the-laravel-model-event

    4、repository

    https://packagist.org/packages/prettus/l5-repository

    https://www.jianshu.com/p/dcaaf801c294

    5、服务

    三分钟学会扩展laravel服务    https://blog.csdn.net/i6448038/article/details/51050024

    创建 Service Provider 测试实例   http://laravelacademy.org/post/796.html

    深入探討Service Provider   https://oomusou.io/laravel/laravel-service-provider/

    6、单元测试

    http://laravelacademy.org/post/2100.html

    1、概述及配置

    Laravel 中集成了PHPUnit进行单元测试,实际上,使用PHPUnit进行单元测试在Laravel中是开箱即用的,测试的配置文件为根目录下的phpunit.xml,该配置文件为我们做好了所有配置工作:

    <?xml version="1.0" encoding="UTF-8"?>
    <phpunit backupGlobals="false"
             backupStaticAttributes="false"
             bootstrap="bootstrap/autoload.php"
             colors="true"
             convertErrorsToExceptions="true"
             convertNoticesToExceptions="true"
             convertWarningsToExceptions="true"
             processIsolation="false"
             stopOnFailure="false"
             syntaxCheck="false">
        <testsuites>
            <testsuite name="Application Test Suite">
                <directory>./tests/</directory>
            </testsuite>
        </testsuites>
        <filter>
            <whitelist>
                <directory suffix=".php">app/</directory>
            </whitelist>
        </filter>
        <php>
            <env name="APP_ENV" value="testing"/>
            <env name="CACHE_DRIVER" value="array"/>
            <env name="SESSION_DRIVER" value="array"/>
            <env name="QUEUE_DRIVER" value="sync"/>
        </php>
    </phpunit>
    

    testsuites中定义了测试文件存放路径为根目录下的tests目录。

    filter中定义了需要进行单元测试的PHP文件存放位置。

    php中配置了测试环境的环境变量,默认APP_ENV为testing,缓存驱动被设置为array,Session驱动被设置为array,队列驱动被设置为sync

  • 相关阅读:
    迪杰斯特拉算法简单分析
    华科机考:二叉排序树(改)
    华科机考:八进制
    华科机考:阶乘
    华科机考:找位置
    华科机考:回文字符串
    华科机考:a+b
    华科机考:N阶楼梯上楼
    华科机考:大整数排序
    iOS 适配iOS9
  • 原文地址:https://www.cnblogs.com/agang-php/p/9484599.html
Copyright © 2011-2022 走看看