Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Test Driven Development(TDD) with Laravel - Trust but Verify
Rating: 3.7 out of 5(32 ratings)
130 students

Test Driven Development(TDD) with Laravel - Trust but Verify

This is a beginner tutorial and a crash course on TDD with laravel to help you get up to date with the TDD concept
Created byDave Partner
Last updated 4/2021
English

What you'll learn

  • Be able to build laravel apps the TDD way
  • Understand general concepts of test driven development and be able to answer questions around it
  • Understand PHP Unit
  • Understand difference between unit testing and feature testing
  • Start a career in code testing

Course content

1 section15 lectures1h 20m total length
  • Before you continue0:04
  • Introduction10:47

    Learn test driven development (tdd) with laravel: write tests from requirements, see them fail, then build features to pass them, and repeat for each new feature.

  • install and setup laravel6:08

    Install and set up Laravel by following the documentation, create a new project folder on Windows, and run a local server to verify the home page.

  • unit tests vs feature tests5:00
  • How to run tests5:10

    Explore running tests in a Laravel TDD workflow using a sample unit test. Learn to run all tests or filter to a single test efficiently.

  • create models, migrations and tests3:59
  • setup sqlite db4:50
  • write first test7:38

    Learn the basics of test driven development with Laravel by writing your first test, using assertions to confirm conditions, and naming tests descriptively to validate post counts and migrations.

  • test database store8:27
  • displaying errors with PHPunit4:32
  • create controller and action6:27
  • debugging tests6:46
  • test for user authentication.7:13

    Learn to enforce authentication and validation in post creation using tests in Laravel, ensuring only logged-in users can create posts.

  • create dummy users3:37

    Learn to create a dummy user with Laravel factories and faker to generate emails and passwords, and test routes by simulating login in a TDD workflow.

  • Bonus0:11

Requirements

  • Basic Knowledge of PHP
  • Must have built basic stuff with any of the Laravel 5 versions before

Description

As a PHP developer, you may use the Test-Driven Development (TDD) technique to develop your software by writing tests. Typically, TDD will divide each task of the development into individual units. A test is then written to ensure that the unit behaves as expected.
Test driven development is a concept usually used in standard projects that many software developers surprisingly don't know.

Every project that uses Test-Driven Development follows three simple steps repeatedly:

  • Write a test for the next bit of functionality you want to add.
  • Write the functional code until the test passes.
  • Refactor both new and old code to make it well structured.

Continue cycling through these three steps, one test at a time, building up the functionality of the system. Testing will help you to refactor, which allows you to improve your design over time and makes some design problems more obvious.

The tests that contain small individual components are called unit tests. While unit tests can be carried out independently, if you test some of the components when they are integrated with other components, you are doing integration testing. The third kind of testing is test stubs. Test stubs allow you to test your code without having to make real calls to a database.
Join me in this course as I expose you to whole new world of programming.

Who this course is for:

  • Any laravel developer who wishes to understand test driven development