---
name: "Socialtext::Resting::Mock"
section: "3pm"
platform: "linux"
package: "libsocialtext-resting-utils-perl"
version: "0.21-2"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/Socialtext::Resting::Mock"
---

# Socialtext::Resting::Mock(3pm)

Fake rester

## NAME

Socialtext::Resting::Mock - Fake rester

## SYNOPSIS

```
  my $rester = Socialtext::Resting::Mock->(file => 'foo');
  # returns content of 'foo'
  $rester->get_page('bar');
```

## FUNCTIONS

### new( %opts )

Create a new fake rester object.  Options:

- file

  File to return the contents of.

### server( $new\_server )

Get or set the server.

### username( $new\_username )

Get or set the username.

### password( $new\_password )

Get or set the password.

### workspace( $new\_workspace )

Get or set the workspace.

### get\_page( $page\_name )

Returns the content of the specified file or the page stored  locally in the object.

### get\_pages

Retrieve a list of pages in the current workspace.

### put\_page( $page\_name )

Stores the page content in the object.

### put\_pagetag( $page, $tag )

Stores the page tags in the object.

### get\_pagetags( $page )

Retrieves page tags stored in the object.

### die\_on\_put( $rc )

Tells the next *put\_page()* to die with the supplied return code.

### accept( $mime\_type )

Stores the requested mime type.

### order( $order )

Stores the requested order.

### get\_taggedpages( $tag )

Retrieves the taggedpages stored in the object.

### set\_taggedpages( $tag, $return )

Store the taggedpages return value in the object.

This is not a real function, but it can make testing easier.

### json\_verbose

Set the json\_verbose flag.

### response

Retrieve a fake response object.

## AUTHOR

Luke Closs, `"<luke.closs at socialtext.com>"`

## COPYRIGHT & LICENSE

Copyright 2006 Luke Closs, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
