Resource icon

xF2 Dev Tools Unit testing XenForo addons - tutorial

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
V.I.P Member
Registered
Joined
Nov 13, 2018
Messages
4,636
Time online
8d 6h 26m
Points
523
ENXF NET submitted a new resource:

Unit testing XenForo addons - tutorial - Learn how to unit test your XenForo addons to make them more robust and error-free

1. Introduction

Unit testing is a process by which individual components (units) of your software are tested. The objective is to isolate a section of code and validate its correctness - ensure that it behaves as expected for the given inputs.

There are multiple levels of testing typically used in software development, including Unit testing, Integration testing, System testing, Acceptance testing and so on. Unit testing is generally the lowest level of testing performed and the...
Read more about this resource...
 

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
V.I.P Member
Registered
Joined
Nov 13, 2018
Messages
4,636
Time online
8d 6h 26m
Points
523
ENXF NET updated Unit testing XenForo addons - tutorial with a new update entry:

v1.1.0 update

  • Feature: added new functionality to Interacts with Extension
    • isolateAddon
  • Feature: Interacts with Registry - adds:
    • fakesRegistry
  • Feature: Interacts with Filesystem - adds:
    • swapFs
    • mockFs
  • bugfix: after mocking the database, set up the entity manager again, so we get the mocked database
  • bugfix: should pass options array through to parent
  • bugfix: cleaned up function visibility for consistency
  • bugfix: override...
Read the rest of this update entry...
 

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
V.I.P Member
Registered
Joined
Nov 13, 2018
Messages
4,636
Time online
8d 6h 26m
Points
523
ENXF NET updated Unit testing XenForo addons - tutorial with a new update entry:

v1.2.0 updates

  • Feature: added new functionality to Interacts with Container
    • mockService
  • Feature: Interacts with Http, new function:
    • fakesHttp

mockService
Mock a service factory builder in the container.

Parameters
  • shortName - the short name of the service class to be mocked
  • mock - optional - the mock closure to define expectations on
Example:
PHP:
<?php namespace Tests\Unit;

use Tests\TestCase;
use...
Read the rest of this update entry...
 
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock