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 | |
include_once dirname(__FILE__) . '/../support/enviromment.php'; | |
// @TODO: excluir depois feito so para testar reflexão em metodos privvados | |
class Foo { | |
private function myPrivateMethod() { | |
return 'blah'; | |
} | |
} |
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
# behat.yml | |
default: | |
formatter: | |
name: 'pretty' | |
#Available formats are: | |
#- pretty: Prints the feature as is. | |
#- progress: Prints one character per step. | |
#- html: Generates a nice looking HTML report. | |
#- junit: Generates a report similar to Ant+JUnit. | |
context: |
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 | |
use Behat\Behat\Context\ClosuredContextInterface, | |
Behat\Behat\Context\TranslatedContextInterface, | |
Behat\Behat\Context\BehatContext, | |
Behat\Behat\Exception\PendingException; | |
use Behat\Gherkin\Node\PyStringNode, | |
Behat\Gherkin\Node\TableNode; | |
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
# features/auth_twitter.feature | |
Feature: Authorization on Twitter | |
In order to use application administration | |
As a user of system | |
I need to be able of authetication with my twitter account | |
@javascript | |
Scenario: Not Authorizing account with twitter | |
Given I am on "session/twitter" | |
And I should see "Sau Online" |
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
context "create questions and answers for the exam" do | |
let(:build_object) { mock().as_null_object } | |
it "should instantiate at least 3 questions" do | |
exam_questions = mock("questions for an exam").as_null_object | |
Exam.any_instance.stub(:questions).and_return(exam_questions) | |
exam_questions.stub(:build).and_return(build_object) | |
exam_questions.should_receive(:build).exactly(3).times | |
get :new |
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 | |
include_once dirname(__FILE__) . '/../support/enviromment.php'; | |
/** | |
* @group models | |
*/ | |
class AccountTest extends CIUnit_TestCase | |
{ | |
protected $tables = array( |
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 Account extends ActiveRecord\Model { | |
static $belongs_to = array( | |
array('person') | |
); | |
static $validates_inclusion_of = array( | |
array('provider', 'in' => array('twitter','facebook'), |
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 | |
/** | |
* @group Helper | |
*/ | |
class PartialsHelperTest extends CIUnit_TestCase | |
{ | |
public function setUp() | |
{ |
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 Student extends Person { | |
static $primary_key = 'id'; | |
static $has_many = array(array('enrollments')); | |
public function __construct(array $attributes = array()) { | |
parent::__construct(array_merge($attributes,array('type'=> __CLASS__ ))); | |
} | |
} |
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
require "open3" | |
watch("application/(models|controllers)/(.*).php") do |match| | |
test_changed_application(match[0]) | |
end | |
watch("tests/(.*/.*)\.php") do |match| | |
phpunit match[0] | |
end |