Zend Framework

Remove Testing related code from Audioscrobbler class by introducing dependency injection for Http Client

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.7.8
  • Fix Version/s: 1.8.0
  • Component/s: None
  • Labels:
    None

Description

Currently the Http client for the audioscrobbler service is set hardcoded inside the constructor.

A testing mode is included to be able to unit-test the audioscrobbler service, because through the hard dependency the Mock Client cannot be used.

This can easily be solved by introducing a setHttpClient function on the audioscrobbler service.

Activity

Hide
Benjamin Eberlei added a comment -

Fixed

Show
Benjamin Eberlei added a comment - Fixed

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: