Changeset 6498
- Timestamp:
- 12/14/07 08:54:34 (1 year ago)
- Files:
-
- doc/trunk/book/10-Forms.txt (modified) (1 diff)
- doc/trunk/book/15-Unit-and-Functional-Testing.txt (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
doc/trunk/book/10-Forms.txt
r5367 r6498 533 533 534 534 // The name field must be a text entry between 2 and 100 characters 535 $myValidator = new sfStringValidator(); 536 $myValidator->initialize($this->getContext(), array( 535 $myValidator = new sfStringValidator($this->getContext(), array( 537 536 'min' => 2, 538 537 'min_error' => 'This name is too short (2 characters minimum)', doc/trunk/book/15-Unit-and-Functional-Testing.txt
r6117 r6498 415 415 // Create a new test browser 416 416 $browser = new sfTestBrowser(); 417 $browser->initialize();418 417 419 418 $browser-> … … 460 459 // Create a new test browser 461 460 $b = new sfTestBrowser(); 462 $b->initialize();463 461 464 462 $b->get('/foobar/show/id/1'); // GET request … … 507 505 // Example functional test for this form 508 506 $b = new sfTestBrowser(); 509 $b->initialize();510 507 $b->get('/foobar/edit/id/1'); 511 508 … … 537 534 // Example functional test for this action 538 535 $b = new sfTestBrowser(); 539 $b->initialize();540 536 $b->get('/foobar/edit?id=1')-> 541 537 click('go', array('name' => 'dummy'))-> … … 560 556 > // Create a new browser 561 557 > $b = new sfBrowser(); 562 > $b->initialize();563 558 > $b->get('/foobar/show/id/1')-> 564 559 > setField('name', 'dummy')-> … … 577 572 [php] 578 573 $b = new sfTestBrowser(); 579 $b->initialize();580 574 $b->get('/foobar/edit/id/1'); 581 575 $request = $b->getRequest(); … … 607 601 [php] 608 602 $b = new sfTestBrowser(); 609 $b->initialize();610 603 $b->get('/foobar/edit/id/1')-> 611 604 isRequestParameter('id', 1)-> … … 633 626 [php] 634 627 $b = new sfTestBrowser(); 635 $b->initialize();636 628 $b-> 637 629 get('/foobar/edit/id/1')-> … … 658 650 [php] 659 651 $b = new sfTestBrowser(); 660 $b->initialize();661 652 $b->get('/foobar/edit/id/1'); 662 653 $dom = $b->getResponseDom(); … … 669 660 [php] 670 661 $b = new sfTestBrowser(); 671 $b->initialize();672 662 $b->get('/foobar/edit/id/1'); 673 663 $c = new sfDomCssSelector($b->getResponseDom()) … … 682 672 [php] 683 673 $b = new sfTestBrowser(); 684 $b->initialize();685 674 $b->get('/foobar/edit/id/1')-> 686 675 checkResponseElement('form input[type="hidden"][value="1"]', true)-> … … 702 691 [php] 703 692 $b = new sfTestBrowser(); 704 $b->initialize();705 693 $b->get('/foobar/edit?id=1')-> 706 694 checkResponseElement('form textarea', 'foo')-> … … 713 701 [php] 714 702 $b = new sfTestBrowser(); 715 $b->initialize();716 703 $b->get('/foobar/edit?id=1')-> 717 704 checkResponseElement('form input', true, array('count' => 3)); … … 749 736 750 737 [php] 751 $b = new sfTestBrowser(); 752 $b->initialize('myapp.example.com', '123.456.789.123'); 738 $b = new sfTestBrowser('myapp.example.com', '123.456.789.123'); 753 739 754 740 ### The test-functional Task … … 871 857 [php] 872 858 $databaseManager = new sfDatabaseManager(); 873 $databaseManager-> initialize();859 $databaseManager->loadConfiguration(); 874 860 875 861 // Optionally, you can retrieve the current database connection … … 920 906 // Create a new test browser 921 907 $b = new sfTestBrowser(); 922 $b->initialize();923 908 924 909 $b->get('/mymodule');