Skip to content

greystate/library-mock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Library Mock

This setup enables me to develop Umbraco macros locally on OS X, by mocking the commonly used extensions in the urn:umbraco.library and urn:ucomponents.* namespaces.

How it works

It works by using a cunning and award-winning (yes, I wish) trick that makes the local file import the mocks, but leaves the remote file untouched.

The actual mocks are written as simple EXSLT functions that either mimic the corresponding library function, or just makes sure to return something that looks like a duck.

Extensions currently being mocked

From umbraco.library

  • CurrentDate()
  • DateAdd()
  • DateGreaterThanOrEqual()
  • DateGreaterThanOrEqualToday()
  • FormatDateTime()
  • GetMedia()
  • GetXmlNodeById()
  • HasAccess()
  • IsLoggedOn()
  • NiceUrl()
  • Replace()
  • RequestQueryString()
  • RequestServerVariables()
  • Split()

From ucomponents.*

  • GetRandomNumbersAsXml() (random)
  • RandomChildNode() (xml)

(Unchecked items are extensions that have an empty stub in the file, but no real implementation yet.)

Here is the reference for the umbraco.library functions on Our Umbraco.

Here is the reference for the uComponents Extensions on ucomponents.org

Installing

To install these, just copy the mocks folder into your xslt folder OR... you can use this super-handy link to get a couple of nifty Terminal commands (who doesn't love those?):

greystate.dk/resources/subtree-merge

About

Simple setup for mocking the extensions in the urn:umbraco.library and urn:ucomponents.* namespaces, for use when developing locally on OS X

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages