This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Create mock BaseCredential called 'MockAdminCredential' whose 'calculate' | |
//function will always return true. All other methods will return NULL | |
//as per the default behavior of a stub. | |
$this->mockAdminCredential = $this->getMockBuilder('BaseCredential') | |
->setMockClassName('MockAdminCredential') | |
->setMethods(array('calculate')) | |
->getMock() | |
->expects($this->any()) | |
->method('calculate') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Having trouble building the same mock in my setUp() method. | |
* What is best practice for building a mock used across several tests? | |
* | |
* Error: | |
* 1) SystemUnderTestTest::testSecondTest | |
* PHPUnit_Framework_Exception: Class "MockStaffCredential" already exists. | |
*/ | |
class SystemUnderTest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" ?> | |
<ruleset name="My-PHPMD" | |
xmlns="http://pmd.sf.net/ruleset/1.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 | |
http://pmd.sf.net/ruleset_xml_schema.xsd" | |
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> | |
<description> | |
MyRuleset... | |
</description> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install resty | |
. resty | |
resty http://localhost:5984 | |
GET /blogs.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Allows key-value store values from objects with the ActAsKeyValueStore Doctrine | |
* behavior to be populated into form value defaults and also assigned/persisted | |
* to with the object using the form. | |
* | |
* @author John Kary <johnkary@ku.edu> | |
*/ | |
abstract class KeyValueStoreForm extends sfFormDoctrine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyForm extends BaseDoctrineForm | |
{ | |
public function setup() | |
{ | |
//tenure_years, integer | |
$this->widgetSchema['tenure_years'] = new sfWidgetFormInputText(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From d8c8d1bc3de5915cc3a7ad822170485750b8aaa4 Mon Sep 17 00:00:00 2001 | |
From: John Kary | |
Date: Thu, 1 Sep 2011 11:17:20 -0500 | |
Subject: [PATCH] [BREAK] Modify FancyBox 1.3.4 to not throw SSL warning in | |
IE6/7 | |
See this thread: | |
http://wolfewebservices.com/blog/fancybox-ssl-security-warning-ie6-and-ie7 | |
Basically, FancyBox creates a blank iFrame in IE6 to display the fancybox content. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adds MIME-type guessers for Office 2007 documents | |
* | |
* @author John Kary <johnkary@ku.edu> | |
*/ | |
class sfValidatorOffice2007File extends sfValidatorFile | |
{ | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for i in 0..50 %} | |
{% set someanswer = 'answer_' ~ i %} | |
{% if form.{{someanswer}} is defined %} | |
<div class="question"> | |
{{ form_label(form.{{someanswer}}) }} | |
{{ form_errors(form.{{someanswer}}) }} | |
{{ form_widget(form.{{someanswer}}_0, {'attr': {'class':'test_choices'} }) }} | |
</div> | |
{% endif %} | |
{% endfor %} |
OlderNewer