PageRenderTime 881ms queryTime 97ms sortTime 321ms getByIdsTime 149ms findMatchingLines 61ms

100+ results results for 'php assert' (881 ms)

Not the results you expected?
DependencyGraphBuilder.cpp https://gitlab.com/x33n/phantomjs | C++ | 227 lines
                    
124            // leftmost symbol, and the leftmost symbol should not be a placeholder.
                    
125            ASSERT(leftmostSymbol != &mLeftSubtree);
                    
126            ASSERT(leftmostSymbol != &mRightSubtree);
                    
223    {
                    
224        TGraphParentNode* currentNode = *iter;
                    
225        currentNode->addDependentNode(node);
                    
                
GenCRC32Section.c https://gitlab.com/envieidoc/Clover | C | 313 lines
                    
6which accompanies this distribution.  The full text of the license may be found at        
                    
7http://opensource.org/licenses/bsd-license.php                                            
                    
8                                                                                          
                    
32#include <string.h>
                    
33#include <assert.h>
                    
34#include "CommonLib.h"
                    
                
InfoTest.php https://gitlab.com/yousafsyed/easternglamor | PHP | 255 lines
                    
1<?php
                    
2/**
                    
11
                    
12class InfoTest extends \PHPUnit_Framework_TestCase
                    
13{
                    
19
                    
20    /** @var \Magento\Framework\Model\Context|\PHPUnit_Framework_MockObject_MockObject */
                    
21    protected $contextMock;
                    
22
                    
23    /** @var \Magento\Framework\Registry|\PHPUnit_Framework_MockObject_MockObject */
                    
24    protected $registryMock;
                    
25
                    
26    /** @var \Magento\Payment\Helper\Data|\PHPUnit_Framework_MockObject_MockObject */
                    
27    protected $paymentHelperMock;
                    
28
                    
29    /** @var \Magento\Framework\Encryption\EncryptorInterface|\PHPUnit_Framework_MockObject_MockObject */
                    
30    protected $encryptorInterfaceMock;
                    
                
MigrationTest.php https://gitlab.com/yousafsyed/easternglamor | PHP | 251 lines
                    
116     * @param string $condition
                    
117     * @return \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\DB\Select
                    
118     */
                    
172
                    
173        $this->assertAttributeEquals($expectedRulesList, '_replaceRules', $setupModel);
                    
174
                    
221        if (isset($expected['aliases_map'])) {
                    
222            $this->assertAttributeEquals($expected['aliases_map'], '_aliasesMap', $setupModel);
                    
223        }
                    
233        return [
                    
234            'plain text replace model' => include __DIR__ . '/_files/data_content_plain_model.php',
                    
235            'plain text replace resource' => include __DIR__ . '/_files/data_content_plain_resource.php',
                    
238            'wiki markup replace' => include __DIR__ . '/_files/data_content_wiki.php',
                    
239            'serialized php replace' => include __DIR__ . '/_files/data_content_serialized.php'
                    
240        ];
                    
                
TagTest.php https://gitlab.com/kimting254/wbms | PHP | 313 lines
                    
1<?php
                    
2/**
                    
2/**
                    
3 * phpDocumentor Var Tag Test
                    
4 * 
                    
4 * 
                    
5 * PHP version 5.3
                    
6 *
                    
8 * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
                    
9 * @license   http://www.opensource.org/licenses/mit-license.php MIT
                    
10 * @link      http://phpdoc.org
                    
12
                    
13namespace phpDocumentor\Reflection\DocBlock;
                    
14
                    
14
                    
15use phpDocumentor\Reflection\DocBlock;
                    
16use phpDocumentor\Reflection\DocBlock\Context;
                    
                
ParameterBagTest.php https://gitlab.com/4gdevs/online-class-record-system | PHP | 224 lines
                    
1<?php
                    
2
                    
15
                    
16class ParameterBagTest extends \PHPUnit_Framework_TestCase
                    
17{
                    
25        $bag = new ParameterBag(array('foo' => 'bar'));
                    
26        $this->assertEquals(array('foo' => 'bar'), $bag->all(), '->all() gets all the input');
                    
27    }
                    
31        $bag = new ParameterBag(array('foo' => 'bar'));
                    
32        $this->assertEquals(array('foo'), $bag->keys());
                    
33    }
                    
38        $bag->add(array('bar' => 'bas'));
                    
39        $this->assertEquals(array('foo' => 'bar', 'bar' => 'bas'), $bag->all());
                    
40    }
                    
45        $bag->add(array('bar' => 'bas'));
                    
46        $this->assertEquals(array('foo' => 'bar', 'bar' => 'bas'), $bag->all());
                    
47        $bag->remove('bar');
                    
                
TaxonomyIndexTidUiTest.php https://gitlab.com/reasonat/test8 | PHP | 220 lines
                    
1<?php
                    
2
                    
97
                    
98        $this->assertEqual($prefix . $this->terms[$i][$j]->getName(), (string) $option);
                    
99        $this->assertEqual($this->terms[$i][$j]->id(), $tid);
                    
109    $this->drupalGet('admin/structure/views/nojs/handler/test_filter_taxonomy_index_tid/default/filter/tid');
                    
110    $this->assertFieldByXPath('//input[@id="edit-options-value"]');
                    
111
                    
125    ];
                    
126    $this->assertIdentical($expected, $view->calculateDependencies()->getDependencies());
                    
127  }
                    
154    $xpath = $this->xpath('//div[@class="view-content"]//a');
                    
155    $this->assertIdentical(2, count($xpath));
                    
156    $xpath = $this->xpath('//div[@class="view-content"]//a[@href=:href]', [':href' => $node2->url()]);
                    
156    $xpath = $this->xpath('//div[@class="view-content"]//a[@href=:href]', [':href' => $node2->url()]);
                    
157    $this->assertIdentical(1, count($xpath));
                    
158    $xpath = $this->xpath('//div[@class="view-content"]//a[@href=:href]', [':href' => $node3->url()]);
                    
                
MediaValidationTest.php https://github.com/bmcclure/CakePHP-Media-Plugin.git | PHP | 305 lines
                    
1<?php
                    
2/**
                    
9 *
                    
10 * PHP 5
                    
11 * CakePHP 2
                    
15 * @package       Media.Test.Case.Lib
                    
16 * @license       http://www.opensource.org/licenses/mit-license.php The MIT License
                    
17 */
                    
20
                    
21require_once dirname(dirname(__FILE__)) . DS . 'constants.php';
                    
22require_once dirname(dirname(dirname(__FILE__))) . DS . 'Fixture' . DS . 'TestData.php';
                    
48		$result = MediaValidation::mimeType($check);
                    
49		$this->assertTrue($result);
                    
50
                    
52		$result = MediaValidation::mimeType($check, array('image/png'));
                    
53		$this->assertFalse($result);
                    
54
                    
                
DiffPanel.java https://gitlab.com/essere.lab.public/qualitas.class-corpus | Java | 365 lines
                    
41 */
                    
42package org.netbeans.modules.php.project.connections.sync.diff;
                    
43
                    
61import org.netbeans.api.diff.StreamSource;
                    
62import org.netbeans.modules.php.api.util.StringUtils;
                    
63import org.netbeans.modules.php.project.connections.RemoteClient;
                    
63import org.netbeans.modules.php.project.connections.RemoteClient;
                    
64import org.netbeans.modules.php.project.connections.RemoteException;
                    
65import org.netbeans.modules.php.project.connections.TmpLocalFile;
                    
65import org.netbeans.modules.php.project.connections.TmpLocalFile;
                    
66import org.netbeans.modules.php.project.connections.sync.SyncItem;
                    
67import org.netbeans.modules.php.project.connections.transfer.TransferFile;
                    
118    public boolean open() throws IOException {
                    
119        assert SwingUtilities.isEventDispatchThread();
                    
120        JButton okButton = new JButton();
                    
                
FieldsFilterTest.php https://gitlab.com/crazybutterfly815/magento2 | PHP | 233 lines
                    
1<?php
                    
2/**
                    
13 */
                    
14class FieldsFilterTest extends \PHPUnit_Framework_TestCase
                    
15{
                    
25
                    
26    /** @var \Magento\Framework\Webapi\Rest\Request|\PHPUnit_Framework_MockObject_MockObject */
                    
27    protected $requestMock;
                    
111
                    
112        $this->assertEquals($expected, $filteredResponse);
                    
113    }
                    
128
                    
129        $this->assertEquals($expected, $filteredResponse);
                    
130    }
                    
163
                    
164        $this->assertEquals($expected, $filteredResponse);
                    
165    }
                    
                
shapes_test.php https://gitlab.com/unofficial-mirrors/moodle | PHP | 165 lines
                    
1<?php
                    
2// This file is part of Moodle - http://moodle.org/
                    
29
                    
30require_once($CFG->dirroot . '/question/type/ddmarker/shapes.php');
                    
31
                    
42        $shape = new qtype_ddmarker_shape_polygon('10, 10; 20, 10; 20, 20; 10, 20');
                    
43        $this->assertFalse($shape->get_coords_interpreter_error()); // No errors.
                    
44    }
                    
47        $shape = new qtype_ddmarker_shape_polygon('10, 10; 20, 10');
                    
48        $this->assertEquals(get_string('formerror_polygonmusthaveatleastthreepoints', 'qtype_ddmarker',
                    
49                        array('shape' => 'polygon', 'coordsstring' => get_string('shape_polygon_coords', 'qtype_ddmarker'))),
                    
54        $shape = new qtype_ddmarker_shape_polygon('10, 10; 20, ; 20, 20; 10, 20');
                    
55        $this->assertEquals(get_string('formerror_onlyusewholepositivenumbers', 'qtype_ddmarker',
                    
56                        array('shape' => 'polygon', 'coordsstring' => get_string('shape_polygon_coords', 'qtype_ddmarker'))),
                    
62                '150,230;150,240;120,240;110,240;90,240');
                    
63        $this->assertEquals(get_string('formerror_repeatedpoint', 'qtype_ddmarker',
                    
64                        array('shape' => 'polygon', 'coordsstring' => get_string('shape_polygon_coords', 'qtype_ddmarker'))),
                    
                
HtmlListTest.php https://bitbucket.org/Dal-Papa/is-340-publish-base.git | PHP | 262 lines
                    
1<?php
                    
2/**
                    
19 * @license    http://framework.zend.com/license/new-bsd     New BSD License
                    
20 * @version    $Id: HtmlListTest.php 24593 2012-01-05 20:35:02Z matthew $
                    
21 */
                    
23// Call Zend_View_Helper_HtmlListTest::main() if this source file is executed directly.
                    
24if (!defined("PHPUnit_MAIN_METHOD")) {
                    
25    define("PHPUnit_MAIN_METHOD", "Zend_View_Helper_HtmlListTest::main");
                    
27
                    
28require_once 'Zend/View.php';
                    
29require_once 'Zend/View/Helper/HtmlList.php';
                    
39 */
                    
40class Zend_View_Helper_HtmlListTest extends PHPUnit_Framework_TestCase
                    
41{
                    
55
                    
56        $suite  = new PHPUnit_Framework_TestSuite("Zend_View_Helper_HtmlListTest");
                    
57        $result = PHPUnit_TextUI_TestRunner::run($suite);
                    
                
AjaxTest.php https://gitlab.com/mohamed_hussein/prodt | PHP | 209 lines
                    
36    $this->drupalGet('admin/ajax-test/theme');
                    
37    $assert = $this->assertSession();
                    
38    $assert->pageTextContains('Current theme: seven');
                    
43    $this->clickLink('Link 8 (ajax)');
                    
44    $assert->assertWaitOnAjaxRequest();
                    
45
                    
56    $this->drupalGet('ajax-test/dialog');
                    
57    $assert = $this->assertSession();
                    
58    $session = $this->getSession();
                    
69    $this->clickLink('Link 8 (ajax)');
                    
70    $assert->assertWaitOnAjaxRequest();
                    
71
                    
84    $this->clickLink('Link 8 (ajax)');
                    
85    $assert->assertWaitOnAjaxRequest();
                    
86    $libraries = $session->evaluateScript('drupalSettings.ajaxPageState.libraries');
                    
                
ExtractTest.php https://bitbucket.org/rchlmrtn/chiari.git | PHP | 154 lines
                    
15		$expected = new Translation_Entry( array( 'singular' => 'baba', 'references' => array('baba.php:1') ) );
                    
16		$result = $this->extractor->extract_entries('<?php __("baba"); ?>', 'baba.php' );
                    
17		$this->assertEquals( $expected, $result->entries['baba'] );
                    
72		$entry = $this->extractor->entry_from_call( array( 'name' => '__', 'args' => array('baba'), 'line' => 10 ), 'baba.php' );
                    
73		$this->assertEquals( $entry, new Translation_Entry( array( 'singular' => 'baba', 'references' => array('baba.php:10') ) ) );
                    
74	}
                    
125	function test_find_function_calls_1_arg_bad_function_call() {
                    
126		$this->assertEquals( array( array( 'name' => 'f', 'args' => array( null ), 'line' => 1 ) ), $this->extractor->find_function_calls( array('f'), '<?php f( g( "baba" ) ); ' ) );
                    
127	}
                    
129	function test_find_function_calls_2_arg_literal_bad() {
                    
130		$this->assertEquals( array( array( 'name' => 'f', 'args' => array( "baba", null ), 'line' => 1 ) ), $this->extractor->find_function_calls( array('f'), '<?php f( "baba", null ); ' ) );
                    
131	}
                    
133	function test_find_function_calls_2_arg_bad_with_parens_literal() {
                    
134		$this->assertEquals( array( array( 'name' => 'f', 'args' => array( null, "baba" ), 'line' => 1 ) ), $this->extractor->find_function_calls( array('f'), '<?php f( g( "dyado", "chicho", "lelya "), "baba" ); ' ) );
                    
135	}
                    
                
MimePartTest.php https://bitbucket.org/larryg/powerhut.git | PHP | 252 lines
                    
1<?php
                    
2
                    
2
                    
3require_once 'Swift/Mime/MimeEntity.php';
                    
4require_once 'Swift/Mime/MimePart.php';
                    
4require_once 'Swift/Mime/MimePart.php';
                    
5require_once 'Swift/Mime/AbstractMimeEntityTest.php';
                    
6require_once 'Swift/Mime/Grammar.php';
                    
14            );
                    
15        $this->assertEqual(
                    
16            Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE, $part->getNestingLevel()
                    
40            );
                    
41        $this->assertEqual('iso-8859-1', $part->getCharset());
                    
42    }
                    
171            );
                    
172        $this->assertEqual('flowed', $part->getFormat());
                    
173    }
                    
                
RelativeLayoutRuleTest.java https://gitlab.com/Codeaurora/platform_sdk | Java | 166 lines
                    
7 *
                    
8 *      http://www.eclipse.org/org/documents/epl-v10.php
                    
9 *
                    
78
                    
79        assertEquals("true", inserted.getStringAttr(ANDROID_URI,
                    
80                "layout_alignParentTop"));
                    
146                String value = elements[1];
                    
147                assertEquals(value, inserted.getStringAttr(ANDROID_URI, name));
                    
148            }
                    
                
AbstractTest.php https://github.com/epugh/solr-for-wordpress.git | PHP | 208 lines
                    
1<?php
                    
2/**
                    
30 * @copyright Copyright 2007-2011 Servigistics, Inc. (http://servigistics.com)
                    
31 * @license http://solr-php-client.googlecode.com/svn/trunk/COPYING New BSD
                    
32 *
                    
40 */
                    
41abstract class Apache_Solr_HttpTransport_AbstractTest extends PHPUnit_Framework_TestCase
                    
42{	
                    
45	// request our copyright file from googlecode for GET and HEAD
                    
46	const GET_URL = "http://solr-php-client.googlecode.com/svn/trunk/COPYING";
                    
47	const GET_RESPONSE_MIME_TYPE = 'text/plain';
                    
51	// post to the issue list page with a search for 'meh'
                    
52	const POST_URL = "http://code.google.com/p/solr-php-client/issues/list";
                    
53	const POST_DATA = "can=2&q=meh&colspec=ID+Type+Status+Priority+Milestone+Owner+Summary&cells=tiles";
                    
66		
                    
67		$this->assertGreaterThan(0, $timeout);
                    
68	}
                    
                
SqlserverTest.php https://gitlab.com/vannh/portal_training | PHP | 247 lines
                    
2/**
                    
3 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
                    
4 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
10 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
11 * @link          http://cakephp.org CakePHP(tm) Project
                    
12 * @since         3.0.0
                    
12 * @since         3.0.0
                    
13 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
                    
14 */
                    
129            ->offset(10);
                    
130        $this->assertEquals('SELECT id, title FROM articles ORDER BY id OFFSET 10 ROWS', $query->sql());
                    
131
                    
143            ->offset(10);
                    
144        $this->assertEquals('SELECT id, title FROM articles ORDER BY (SELECT NULL) OFFSET 10 ROWS', $query->sql());
                    
145
                    
                
license2rtf.js https://gitlab.com/CORP-RESELLER/node | JavaScript | 332 lines
                    
2
                    
3const assert = require('assert');
                    
4const Stream = require('stream');
                    
40 */
                    
41function ParagraphParser() {
                    
42  const self = this;
                    
131    var result = /^(\s*)(\d+\.|\*|-)?\s*/.exec(line);
                    
132    assert.ok(result);
                    
133    // The number of characters that will be stripped from the beginning of
                    
168}
                    
169inherits(ParagraphParser, Stream);
                    
170
                    
320const line_splitter = new LineSplitter();
                    
321const paragraph_parser = new ParagraphParser();
                    
322const unwrapper = new Unwrapper();
                    
                
packet.cpp https://gitlab.com/iranjith4/hhvm | C++ | 432 lines
                    
2   +----------------------------------------------------------------------+
                    
3   | HipHop for PHP                                                       |
                    
4   +----------------------------------------------------------------------+
                    
5   | Copyright (c) 2010-2016 Facebook, Inc. (http://www.facebook.com)     |
                    
6   | Copyright (c) 1997-2010 The PHP Group                                |
                    
7   +----------------------------------------------------------------------+
                    
7   +----------------------------------------------------------------------+
                    
8   | This source file is subject to version 3.01 of the PHP license,      |
                    
9   | that is bundled with this package in the file LICENSE, and is        |
                    
10   | available through the world-wide-web at the following url:           |
                    
11   | http://www.php.net/license/3_01.txt                                  |
                    
12   | If you did not receive a copy of the PHP license and are unable to   |
                    
13   | obtain it through the world-wide-web, please send a note to          |
                    
14   | license@php.net so we can mail you a copy immediately.               |
                    
15   +----------------------------------------------------------------------+
                    
                
CookieJarTest.php https://bitbucket.org/hill2steve/mobileroom.git | PHP | 191 lines
                    
46
                    
47        $this->assertEquals(array($cookie1, $cookie2), $cookieJar->all(), '->all() returns all cookies in the jar');
                    
48    }
                    
95        $barCookie = $cookieJar->get('bar', '/', '.blog.symfony.com');
                    
96        $phpCookie = $cookieJar->get('PHPSESSID');
                    
97
                    
99        $this->assertInstanceOf('Symfony\Component\BrowserKit\Cookie', $barCookie);
                    
100        $this->assertInstanceOf('Symfony\Component\BrowserKit\Cookie', $phpCookie);
                    
101        $this->assertEquals('foo', $fooCookie->getValue());
                    
102        $this->assertEquals('bar', $barCookie->getValue());
                    
103        $this->assertEquals('id', $phpCookie->getValue());
                    
104        $this->assertEquals($timestamp, $fooCookie->getExpiresTime());
                    
105        $this->assertNull($barCookie->getExpiresTime());
                    
106        $this->assertEquals($timestamp, $phpCookie->getExpiresTime());
                    
107    }
                    
                
MaildirFolderTest.php https://github.com/mfairchild365/zf2.git | PHP | 444 lines
                    
1<?php
                    
2/**
                    
36 */
                    
37class MaildirFolderTest extends \PHPUnit_Framework_TestCase
                    
38{
                    
184
                    
185        $this->assertEquals($mail->getCurrentFolder(), 'subfolder.test');
                    
186    }
                    
203        try {
                    
204            // explicit call of __toString() needed for PHP < 5.2
                    
205            $this->assertEquals($mail->getFolders()->subfolder->__toString(), 'subfolder');
                    
214        try {
                    
215            $this->assertEquals($mail->getFolders()->subfolder->key(), 'test');
                    
216        } catch (\Exception $e) {
                    
235
                    
236            // explicit call of __toString() needed for PHP < 5.2
                    
237            $found_folders[$folder->__toString()] = $localName;
                    
                
RouteCollectionBuilderTest.php https://gitlab.com/Sigpot/AirSpot | PHP | 324 lines
                    
1<?php
                    
2
                    
18
                    
19class RouteCollectionBuilderTest extends \PHPUnit_Framework_TestCase
                    
20{
                    
50        // we should get back a RouteCollectionBuilder
                    
51        $this->assertInstanceOf('Symfony\Component\Routing\RouteCollectionBuilder', $importedRoutes);
                    
52
                    
55        $route = $addedCollection->get('one_test_route');
                    
56        $this->assertSame($originalRoute, $route);
                    
57        // should return file_resource.yml, which is in the original collection
                    
57        // should return file_resource.yml, which is in the original collection
                    
58        $this->assertCount(1, $addedCollection->getResources());
                    
59
                    
60        // make sure the routes were imported into the top-level builder
                    
61        $this->assertCount(1, $routes->build());
                    
62    }
                    
                
shell.test.php https://github.com/cgajardo/repositorium.git | PHP | 501 lines
                    
1<?php
                    
2/**
                    
6 *
                    
7 * PHP versions 4 and 5
                    
8 *
                    
8 *
                    
9 * CakePHP :  Rapid Development Framework (http://cakephp.org)
                    
10 * Copyright 2006-2010, Cake Software Foundation, Inc.
                    
15 * @copyright     Copyright 2006-2010, Cake Software Foundation, Inc.
                    
16 * @link          http://cakephp.org CakePHP Project
                    
17 * @package       cake
                    
18 * @subpackage    cake.tests.cases.console.libs
                    
19 * @since         CakePHP v 1.2.0.7726
                    
20 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
                    
32	$argv = false;
                    
33	require CAKE . 'console' .  DS . 'cake.php';
                    
34	ob_end_clean();
                    
                
AbstractMultiSelectonTest.js https://github.com/Wkasel/qooxdoo.git | JavaScript | 250 lines
                    
11     LGPL: http://www.gnu.org/licenses/lgpl.html
                    
12     EPL: http://www.eclipse.org/org/documents/epl-v10.php
                    
13     See the LICENSE file in the project's top-level directory for details.
                    
67      var result = this._widget.getSelection();
                    
68      this._assertArrayEquals(expected, result, "Selection is wrong");
                    
69
                    
74      expected = [this._selection[0]];
                    
75      this._assertArrayEquals(expected, result, "Selection is wrong");
                    
76      this.flush();
                    
86      var that = this;
                    
87      this.assertEventFired(widget, "changeSelection", function () {
                    
88        widget.selectAll();
                    
91        // Tests the result from the event
                    
92        that._assertArrayEquals(that._getChildren(), event.getData(),
                    
93          "Selection is wrong!");
                    
                
ReleaseCheckList.test.php https://github.com/quarkness/piwik.git | PHP | 219 lines
                    
1<?php
                    
2if(!defined('PIWIK_CONFIG_TEST_INCLUDED'))
                    
3{
                    
4	require_once dirname(__FILE__)."/../../tests/config_test.php";
                    
5}
                    
12    {
                    
13    	$this->globalConfig = _parse_ini_file(PIWIK_PATH_TEST_TO_ROOT . '/config/global.ini.php', true);
                    
14//    	var_dump($globalConfig);
                    
37    		$content = file_get_contents($file);
                    
38    		$this->assertFalse(strpos($content, $patternFailIfFound), 'found in '.$file);
                    
39    	}
                    
50    	}
                    
51    	$this->assertEqual($value, $valueExpected, "$section -> $optionName was '".var_export($value, true)."', expected '".var_export($valueExpected, true)."'");
                    
52    }
                    
75    {
                    
76    	require_once 'Tracker/Db.php';
                    
77    	$this->assertTrue(Piwik_Tracker_Db::isProfilingEnabled() === false, 'SQL profiler should be disabled in production! See Piwik_Tracker_Db::$profiling');
                    
                
RowTest.php https://github.com/nehxby/db_type.git | PHP | 228 lines
                    
1<?php
                    
2class DB_Type_Pgsql_Test_RowTest extends DB_Type_Test_Util_TypeTestCase
                    
209    	        ),
                    
210    	        /* Failed asserting in testInputOutputInput
                    
211    	        because output truncates `not_in_items` field.
                    
211    	        because output truncates `not_in_items` field.
                    
212    	        Usage example see in examples/itemsInput.php
                    
213    	        array(
                    
                
TestZoneLinkBanner.java https://github.com/orchestra-io/sample-openx.git | Java | 245 lines
                    
78		} catch (XmlRpcException e) {
                    
79			assertEquals(ErrorMessage.WRONG_ERROR_MESSAGE, errorMsg, e
                    
80					.getMessage());
                    
96		
                    
97		assertTrue(result);
                    
98	}
                    
124		
                    
125		assertTrue(result);
                    
126	}
                    
142		
                    
143		assertTrue(result);
                    
144	}
                    
155		Integer zoneId = createZone();
                    
156		assertNotNull(zoneId);
                    
157		deleteZone(zoneId);
                    
                
ArrayCookieJarTest.php https://gitlab.com/x33n/respond | PHP | 353 lines
                    
1<?php
                    
2
                    
56        foreach ($cookies as $cookie) {
                    
57            $this->assertTrue($this->jar->add($cookie));
                    
58        }
                    
59
                    
60        $this->assertEquals(3, count($this->jar));
                    
61        $this->assertEquals(3, count($this->jar->getIterator()));
                    
61        $this->assertEquals(3, count($this->jar->getIterator()));
                    
62        $this->assertEquals($cookies, $this->jar->all(null, null, null, false, false));
                    
63    }
                    
71        $this->jar->removeExpired();
                    
72        $this->assertEquals(array($cookies[0], $cookies[2]), $this->jar->all());
                    
73    }
                    
81        $this->jar->removeTemporary();
                    
82        $this->assertEquals(array($cookies[2]), $this->jar->all());
                    
83    }
                    
                
custom_completion_test.php https://github.com/mackensen/moodle.git | PHP | 239 lines
                    
1<?php
                    
2// This file is part of Moodle - http://moodle.org/
                    
37global $CFG;
                    
38require_once($CFG->libdir . '/completionlib.php');
                    
39require_once($CFG->dirroot . '/mod/assign/tests/generator.php');
                    
103        $customcompletion = new custom_completion($cm, (int)$student->id);
                    
104        $this->assertEquals($status, $customcompletion->get_state($rule));
                    
105    }
                    
137        $customcompletion = new custom_completion($cm, (int)$student->id);
                    
138        $this->assertEquals($status, $customcompletion->get_state($rule));
                    
139    }
                    
146        $rules = custom_completion::get_defined_custom_rules();
                    
147        $this->assertCount(1, $rules);
                    
148        $this->assertEquals('completionsubmit', reset($rules));
                    
169        // Confirm that defined rules and rule descriptions are consistent with each other.
                    
170        $this->assertEquals(count($rules), count($ruledescriptions));
                    
171        foreach ($rules as $rule) {
                    
                
TestCase.php https://github.com/KaRLsM/SIFO.git | PHP | 250 lines
                    
56 */
                    
57abstract class PHPUnit_Extensions_Database_TestCase extends PHPUnit_Framework_TestCase
                    
58{
                    
140     * @param string $schema
                    
141     * @return PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection
                    
142     */
                    
229     */
                    
230    public static function assertTablesEqual(PHPUnit_Extensions_Database_DataSet_ITable $expected, PHPUnit_Extensions_Database_DataSet_ITable $actual, $message = '')
                    
231    {
                    
237    /**
                    
238     * Asserts that two given datasets are equal.
                    
239     *
                    
243     */
                    
244    public static function assertDataSetsEqual(PHPUnit_Extensions_Database_DataSet_IDataSet $expected, PHPUnit_Extensions_Database_DataSet_IDataSet $actual, $message = '')
                    
245    {
                    
                
Location.js https://github.com/stephaneerard/qooxdoo.git | JavaScript | 406 lines
                    
11     LGPL: http://www.gnu.org/licenses/lgpl.html
                    
12     EPL: http://www.eclipse.org/org/documents/epl-v10.php
                    
13     See the LICENSE file in the project's top-level directory for details.
                    
72      var pos = qx.bom.element.Location.get(document.body);
                    
73      this.assertEquals(0, pos.left);
                    
74      this.assertEquals(0, pos.top);
                    
83      var pos = qx.bom.element.Location.get(document.body);
                    
84      this.assertEquals(10, pos.left);
                    
85      this.assertEquals(20, pos.top);
                    
92      var pos = qx.bom.element.Location.get(document.body);
                    
93      this.assertEquals(0, pos.left);
                    
94      this.assertEquals(0, pos.top);
                    
101      var pos = qx.bom.element.Location.get(document.body);
                    
102      this.assertEquals(0, pos.left);
                    
103      this.assertEquals(0, pos.top);
                    
                
AbstractTokenTest.php https://gitlab.com/fabian.morales/marlon_becerra | PHP | 285 lines
                    
1<?php
                    
2
                    
57
                    
58class AbstractTokenTest extends \PHPUnit_Framework_TestCase
                    
59{
                    
63        $token->setUser('fabien');
                    
64        $this->assertEquals('fabien', $token->getUsername());
                    
65
                    
66        $token->setUser(new TestUser('fabien'));
                    
67        $this->assertEquals('fabien', $token->getUsername());
                    
68
                    
71        $token->setUser($user);
                    
72        $this->assertEquals('fabien', $token->getUsername());
                    
73    }
                    
96
                    
97        $this->assertEquals($token->getRoles(), $uToken->getRoles());
                    
98        $this->assertEquals($token->getAttributes(), $uToken->getAttributes());
                    
                
linear_solver.h https://gitlab.com/Namdhari/cgal-AnatoMeCo | C Header | 478 lines
                    
27 *    YEAR=November 2005,
                    
28 *    URL=http://www.loria.fr/~levy/php/article.php?pub=../publications/papers/2005/Numerics
                    
29 * }
                    
208        unsigned int index() const {
                    
209            CGAL_assertion(index_ != -1) ;
                    
210            return (unsigned int)(index_) ;
                    
247    Variable& variable(unsigned int idx) {
                    
248        CGAL_assertion(idx < nb_variables_) ;
                    
249        return variable_[idx] ;
                    
252    const Variable& variable(unsigned int idx) const {
                    
253        CGAL_assertion(idx < nb_variables_) ;
                    
254        return variable_[idx] ;
                    
319        norm = sqrt(norm) ;
                    
320        CGAL_assertion( fabs(norm)>1e-40 );
                    
321        scale_row(weight / norm) ;
                    
                
ProxyMagicMethodsTest.php https://github.com/nattaphat/hgis.git | PHP | 285 lines
                    
1<?php
                    
2/*
                    
24use Doctrine\Common\Proxy\Exception\UnexpectedValueException;
                    
25use PHPUnit_Framework_TestCase;
                    
26use ReflectionClass;
                    
32 */
                    
33class ProxyMagicMethodsTest extends PHPUnit_Framework_TestCase
                    
34{
                    
50    /**
                    
51     * @var \PHPUnit_Framework_MockObject_MockObject|Callable
                    
52     */
                    
88
                    
89        $this->assertSame('id', $proxy->id);
                    
90        $this->assertSame('modifiedPublicField', $proxy->publicField);
                    
90        $this->assertSame('modifiedPublicField', $proxy->publicField);
                    
91        $this->assertSame('test', $proxy->test);
                    
92        $this->assertSame('not defined', $proxy->notDefined);
                    
                
MailboxHeader.php https://bitbucket.org/amitholkar/zenfile-18-05.git | PHP | 358 lines
                    
1<?php
                    
2
                    
88     * <code>
                    
89     * <?php
                    
90     * //Sets two mailboxes in the Header, one with a personal name
                    
116     * <code>
                    
117     * <?php
                    
118     * $header = new Swift_Mime_Headers_MailboxHeader('From',
                    
147     * <code>
                    
148     * <?php
                    
149     * $header = new Swift_Mime_Headers_MailboxHeader('From',
                    
175     * <code>
                    
176     * <?php
                    
177     * //Sets three email addresses as the Header data
                    
263            }
                    
264            $this->_assertValidAddress($address);
                    
265            $actualMailboxes[$address] = $name;
                    
                
block.h https://github.com/tstarling/hiphop-php.git | C Header | 290 lines
                    
2   +----------------------------------------------------------------------+
                    
3   | HipHop for PHP                                                       |
                    
4   +----------------------------------------------------------------------+
                    
6   +----------------------------------------------------------------------+
                    
7   | This source file is subject to version 3.01 of the PHP license,      |
                    
8   | that is bundled with this package in the file LICENSE, and is        |
                    
9   | available through the world-wide-web at the following url:           |
                    
10   | http://www.php.net/license/3_01.txt                                  |
                    
11   | If you did not receive a copy of the PHP license and are unable to   |
                    
12   | obtain it through the world-wide-web, please send a note to          |
                    
13   | license@php.net so we can mail you a copy immediately.               |
                    
14   +----------------------------------------------------------------------+
                    
16
                    
17#ifndef incl_HPHP_VM_BLOCK_H_
                    
18#define incl_HPHP_VM_BLOCK_H_
                    
                
PersistentTokenBasedRememberMeServicesTest.php https://github.com/jdewit/symfony.git | PHP | 329 lines
                    
1<?php
                    
2
                    
26
                    
27class PersistentTokenBasedRememberMeServicesTest extends \PHPUnit_Framework_TestCase
                    
28{
                    
32
                    
33        $this->assertNull($service->autoLogin(new Request()));
                    
34    }
                    
42
                    
43        $this->assertNull($service->autoLogin($request));
                    
44        $this->assertTrue($request->attributes->get(RememberMeServicesInterface::COOKIE_ATTR_NAME)->isCleared());
                    
64
                    
65        $this->assertNull($service->autoLogin($request));
                    
66        $this->assertTrue($request->attributes->get(RememberMeServicesInterface::COOKIE_ATTR_NAME)->isCleared());
                    
89
                    
90        $this->assertNull($service->autoLogin($request));
                    
91        $this->assertTrue($request->attributes->has(RememberMeServicesInterface::COOKIE_ATTR_NAME));
                    
                
UtilTests.java https://bitbucket.org/haris_peco/debrief.git | Java | 209 lines
                    
12 * You can obtain a copy of the LGPL 2.1 license at
                    
13 * http://www.opensource.org/licenses/lgpl-2.1.php
                    
14 * 
                    
15 * You can obtain a copy of the CDDL 1.0 license at
                    
16 * http://www.opensource.org/licenses/cddl1.php
                    
17 * 
                    
18 * You can obtain a copy of the EPL 1.0 license at
                    
19 * http://www.opensource.org/licenses/eclipse-1.0.php
                    
20 * 
                    
84            throws IllegalPathException {
                    
85        assertEquals(expectedOut, Util.getPathTemplateWithoutRegExps(in, null));
                    
86    }
                    
147    public void testDoesImplements() {
                    
148        assertTrue(Util.doesImplement(String.class, CharSequence.class));
                    
149        assertFalse(Util.doesImplement(CharSequence.class, String.class));
                    
                
authentication_documentation.html https://github.com/cgajardo/repositorium.git | HTML | 355 lines
                    
74Date: Sat, 18 Sep 2004 19:25:18 GMT
                    
75Server: Apache/1.3.29 (Unix) PHP/4.3.4
                    
76WWW-Authenticate: Basic realm="SimpleTest basic authentication"
                    
83                We are trying to get away from visual inspection though, and so SimpleTest
                    
84                allows to make automated assertions against the challenge.
                    
85                Here is a thorough test of our header...
                    
89        $this-&gt;get('http://www.lastcraft.com/protected/');<strong>
                    
90        $this-&gt;assertAuthentication('Basic');
                    
91        $this-&gt;assertResponse(401);
                    
91        $this-&gt;assertResponse(401);
                    
92        $this-&gt;assertRealm('SimpleTest basic authentication');</strong>
                    
93    }
                    
108        $this-&gt;get('http://www.lastcraft.com/protected/');
                    
109        $this-&gt;assertRealm(<strong>new PatternExpectation('/simpletest/i')</strong>);
                    
110    }
                    
                
shell.test.php https://github.com/fektor/cakephp.git | PHP | 501 lines
                    
1<?php
                    
2/**
                    
6 *
                    
7 * PHP versions 4 and 5
                    
8 *
                    
8 *
                    
9 * CakePHP :  Rapid Development Framework (http://cakephp.org)
                    
10 * Copyright 2005-2011, Cake Software Foundation, Inc.
                    
15 * @copyright     Copyright 2005-2011, Cake Software Foundation, Inc.
                    
16 * @link          http://cakephp.org CakePHP Project
                    
17 * @package       cake
                    
18 * @subpackage    cake.tests.cases.console.libs
                    
19 * @since         CakePHP v 1.2.0.7726
                    
20 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
                    
32	$argv = false;
                    
33	require CAKE . 'console' .  DS . 'cake.php';
                    
34	ob_end_clean();
                    
                
Validator.php https://bitbucket.org/amitholkar/zenfile-18-05.git | PHP | 206 lines
                    
1<?php
                    
2
                    
39        $this->aliases = array();
                    
40        // PHP is a bit lax with integer <=> string conversions in
                    
41        // arrays, so we don't use the identical !== comparison
                    
63            ->assertNotEmpty()
                    
64            ->assertIsString(); // implicit assertIsString handled by InterchangeBuilder
                    
65        array_pop($this->context);
                    
76        $this->with($d, 'description')
                    
77            ->assertNotEmpty();
                    
78
                    
80        $this->with($d, 'type')
                    
81            ->assertNotEmpty();
                    
82        $this->with($d, 'typeAllowsNull')
                    
82        $this->with($d, 'typeAllowsNull')
                    
83            ->assertIsBool();
                    
84        try {
                    
                
SecurityTest.php https://bitbucket.org/projectangelfaces/project-angel-faces.git | PHP | 305 lines
                    
1<?php
                    
2/**
                    
2/**
                    
3 * CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html>
                    
4 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
10 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
11 * @link          http://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests
                    
12 * @since         CakePHP(tm) v 1.2.0.5432
                    
12 * @since         CakePHP(tm) v 1.2.0.5432
                    
13 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
                    
14 */
                    
38		Configure::write('Security.level', 'high');
                    
39		$this->assertEquals(10, Security::inactiveMins());
                    
40
                    
41		Configure::write('Security.level', 'medium');
                    
42		$this->assertEquals(100, Security::inactiveMins());
                    
43
                    
                
OAuthTest.php https://gitlab.com/hunt9310/ras | PHP | 298 lines
                    
1<?php
                    
2namespace Test\Integration;
                    
3
                    
4require_once dirname(__DIR__) . '/Setup.php';
                    
5
                    
26
                    
27        $this->assertEquals(true, $result->success);
                    
28        $credentials = $result->credentials;
                    
28        $credentials = $result->credentials;
                    
29        $this->assertNotNull($credentials->accessToken);
                    
30        $this->assertNotNull($credentials->refreshToken);
                    
30        $this->assertNotNull($credentials->refreshToken);
                    
31        $this->assertEquals('bearer', $credentials->tokenType);
                    
32        $this->assertNotNull($credentials->expiresAt);
                    
38    */
                    
39    public function testAssertsHasCredentials()
                    
40    {
                    
                
MaildirTest.php https://github.com/mrbanzai/zf2.git | PHP | 444 lines
                    
1<?php
                    
2/**
                    
36 */
                    
37class MaildirTest extends \PHPUnit_Framework_TestCase
                    
38{
                    
159
                    
160        $this->assertTrue($mail->hasTop);
                    
161    }
                    
166
                    
167        $this->assertFalse($mail->hasCreate);
                    
168    }
                    
185        $count = $mail->countMessages();
                    
186        $this->assertEquals(5, $count);
                    
187    }
                    
195        $sizes = $mail->getSize();
                    
196        $this->assertEquals($shouldSizes, $sizes);
                    
197    }
                    
                
otb.c https://bitbucket.org/ardalanaz/dava.framework.git | C | 387 lines
                    
25%                                                                             %
                    
26%    http://www.imagemagick.org/script/license.php                            %
                    
27%                                                                             %
                    
128  */
                    
129  assert(image_info != (const ImageInfo *) NULL);
                    
130  assert(image_info->signature == MagickSignature);
                    
133      image_info->filename);
                    
134  assert(exception != (ExceptionInfo *) NULL);
                    
135  assert(exception->signature == MagickSignature);
                    
324  */
                    
325  assert(image_info != (const ImageInfo *) NULL);
                    
326  assert(image_info->signature == MagickSignature);
                    
326  assert(image_info->signature == MagickSignature);
                    
327  assert(image != (Image *) NULL);
                    
328  assert(image->signature == MagickSignature);
                    
                
Config.php https://github.com/mrbanzai/zf2.git | PHP | 536 lines
                    
1<?php
                    
2/**
                    
211    /**
                    
212     * Support isset() overloading on PHP 5.1
                    
213     *
                    
222    /**
                    
223     * Support unset() overloading on PHP 5.1
                    
224     *
                    
468     */
                    
469    protected function _assertValidExtend($extendingSection, $extendedSection)
                    
470    {
                    
                
ManagerTest.php https://gitlab.com/yousafsyed/easternglamor | PHP | 314 lines
                    
1<?php
                    
2/**
                    
23 *
                    
24 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
                    
25 */
                    
25 */
                    
26class ManagerTest extends \PHPUnit_Framework_TestCase
                    
27{
                    
33    /**
                    
34     * @var ComponentDefinition|\PHPUnit_Framework_MockObject_MockObject
                    
35     */
                    
38    /**
                    
39     * @var CacheInterface|\PHPUnit_Framework_MockObject_MockObject
                    
40     */
                    
43    /**
                    
44     * @var InterpreterInterface|\PHPUnit_Framework_MockObject_MockObject
                    
45     */
                    
                
GalleryManagementTest.php https://gitlab.com/yousafsyed/easternglamor | PHP | 290 lines
                    
1<?php
                    
2/**
                    
11
                    
12class GalleryManagementTest extends \PHPUnit_Framework_TestCase
                    
13{
                    
19    /**
                    
20     * @var \PHPUnit_Framework_MockObject_MockObject
                    
21     */
                    
24    /**
                    
25     * @var \PHPUnit_Framework_MockObject_MockObject
                    
26     */
                    
29    /**
                    
30     * @var \PHPUnit_Framework_MockObject_MockObject
                    
31     */
                    
34    /**
                    
35     * @var \PHPUnit_Framework_MockObject_MockObject
                    
36     */
                    
                
symbol_table.cpp https://gitlab.com/iranjith4/hhvm | C++ | 318 lines
                    
2   +----------------------------------------------------------------------+
                    
3   | HipHop for PHP                                                       |
                    
4   +----------------------------------------------------------------------+
                    
6   +----------------------------------------------------------------------+
                    
7   | This source file is subject to version 3.01 of the PHP license,      |
                    
8   | that is bundled with this package in the file LICENSE, and is        |
                    
9   | available through the world-wide-web at the following url:           |
                    
10   | http://www.php.net/license/3_01.txt                                  |
                    
11   | If you did not receive a copy of the PHP license and are unable to   |
                    
12   | obtain it through the world-wide-web, please send a note to          |
                    
13   | license@php.net so we can mail you a copy immediately.               |
                    
14   +----------------------------------------------------------------------+
                    
16
                    
17#include "hphp/compiler/analysis/symbol_table.h"
                    
18#include <map>
                    
                
VCardTest.php https://gitlab.com/deichbrise/vcard-viewhelper | PHP | 355 lines
                    
1<?php
                    
2
                    
5// required to load
                    
6require_once __DIR__ . '/../vendor/autoload.php';
                    
7
                    
8/*
                    
9 * This file is part of the VCard PHP Class from Jeroen Desloovere.
                    
10 *
                    
17/**
                    
18 * This class will test our VCard PHP Class which can generate VCards.
                    
19 *
                    
21 */
                    
22class VCardTest extends \PHPUnit_Framework_TestCase
                    
23{
                    
81    {
                    
82        $this->assertEquals($this->vcard, $this->vcard->addAddress());
                    
83    }
                    
                
XmlTest.php https://github.com/mfairchild365/zf2.git | PHP | 368 lines
                    
1<?php
                    
2/**
                    
33 */
                    
34class XmlTest extends \PHPUnit_Framework_TestCase
                    
35{
                    
57        $config = new Xml($this->_xmlFileConfig, 'all');
                    
58        $this->assertEquals('all', $config->hostname);
                    
59        $this->assertEquals('live', $config->db->name);
                    
59        $this->assertEquals('live', $config->db->name);
                    
60        $this->assertEquals('multi', $config->one->two->three);
                    
61        $this->assertNull(@$config->nonexistent); // property doesn't exist
                    
66        $config = new Xml($this->_xmlFileConfig, 'staging');
                    
67        $this->assertEquals('false', $config->debug); // only in staging
                    
68        $this->assertEquals('thisname', $config->name); // only in all
                    
68        $this->assertEquals('thisname', $config->name); // only in all
                    
69        $this->assertEquals('username', $config->db->user); // only in all (nested version)
                    
70        $this->assertEquals('staging', $config->hostname); // inherited and overridden
                    
                
CommentFieldsTest.php https://gitlab.com/reasonat/test8 | PHP | 235 lines
                    
1<?php
                    
2
                    
34    $field = FieldConfig::loadByName('comment', 'comment', 'comment_body');
                    
35    $this->assertTrue(!empty($field), 'The comment_body field is added when a comment bundle is created');
                    
36
                    
41    $field_storage = FieldStorageConfig::loadByName('comment', 'comment_body');
                    
42    $this->assertTrue($field_storage, 'The comment_body field storage was not deleted');
                    
43
                    
51    $field_storage = FieldStorageConfig::loadByName('comment', 'comment_body');
                    
52    $this->assertTrue($field_storage, 'The comment_body field exists');
                    
53    $field = FieldConfig::loadByName('comment', 'comment', 'comment_body');
                    
53    $field = FieldConfig::loadByName('comment', 'comment', 'comment_body');
                    
54    $this->assertTrue(isset($field), format_string('The comment_body field is present for comments on type @type', array('@type' => $type_name)));
                    
55
                    
58    $field = FieldConfig::load('node.test_node_type.who_likes_ponies');;
                    
59    $this->assertEqual($field->getDefaultValueLiteral()[0]['status'], CommentItemInterface::CLOSED);
                    
60  }
                    
                
walkthrough_test.php https://github.com/pauln/moodle.git | PHP | 309 lines
                    
1<?php
                    
2// This file is part of Moodle - http://moodle.org/
                    
30global $CFG;
                    
31require_once(dirname(__FILE__) . '/../../../engine/lib.php');
                    
32require_once(dirname(__FILE__) . '/../../../engine/tests/helpers.php');
                    
53                $this->get_does_not_contain_feedback_expectation());
                    
54        $this->assertEquals(get_string('true', 'qtype_truefalse'),
                    
55                $this->quba->get_right_answer_summary($this->slot));
                    
55                $this->quba->get_right_answer_summary($this->slot));
                    
56        $this->assertRegExp('/' . preg_quote($tf->questiontext, '/') . '/',
                    
57                $this->quba->get_question_summary($this->slot));
                    
57                $this->quba->get_question_summary($this->slot));
                    
58        $this->assertNull($this->quba->get_response_summary($this->slot));
                    
59
                    
92                new question_pattern_expectation('/class="r0 correct"/'));
                    
93        $this->assertEquals(get_string('true', 'qtype_truefalse'),
                    
94                $this->quba->get_response_summary($this->slot));
                    
                
SoftDeleteBehaviorTest.php https://github.com/1989gaurav/Propel.git | PHP | 413 lines
                    
1<?php
                    
2
                    
11
                    
12require_once dirname(__FILE__) . '/../../../tools/helpers/bookstore/BookstoreTestBase.php';
                    
13
                    
34		$table2 = Table4Peer::getTableMap();
                    
35		$this->assertEquals(count($table2->getColumns()), 3, 'SoftDelete adds one columns by default');
                    
36		$this->assertTrue(method_exists('Table4', 'getDeletedAt'), 'SoftDelete adds an updated_at column by default');
                    
37		$table1 = Table5Peer::getTableMap();
                    
38		$this->assertEquals(count($table1->getColumns()), 3, 'SoftDelete does not add a column when it already exists');
                    
39		$this->assertTrue(method_exists('Table5', 'getDeletedOn'), 'SoftDelete allows customization of deleted_column name');
                    
43	{
                    
44		$this->assertTrue(Table4Peer::isSoftDeleteEnabled(), 'The static soft delete is enabled by default');
                    
45		Table4Peer::disableSoftDelete();
                    
45		Table4Peer::disableSoftDelete();
                    
46		$this->assertFalse(Table4Peer::isSoftDeleteEnabled(), 'disableSoftDelete() disables the static soft delete');
                    
47		Table4Peer::enableSoftDelete();
                    
                
ParameterTest.php https://gitlab.com/x33n/respond | PHP | 416 lines
                    
1<?php
                    
2
                    
28        $p = new Parameter($this->data);
                    
29        $this->assertEquals('foo', $p->getName());
                    
30        $this->assertEquals('bar', $p->getType());
                    
30        $this->assertEquals('bar', $p->getType());
                    
31        $this->assertEquals(true, $p->getRequired());
                    
32        $this->assertEquals('123', $p->getDefault());
                    
32        $this->assertEquals('123', $p->getDefault());
                    
33        $this->assertEquals('456', $p->getDescription());
                    
34        $this->assertEquals(2, $p->getMinLength());
                    
34        $this->assertEquals(2, $p->getMinLength());
                    
35        $this->assertEquals(5, $p->getMaxLength());
                    
36        $this->assertEquals('body', $p->getLocation());
                    
36        $this->assertEquals('body', $p->getLocation());
                    
37        $this->assertEquals('static!', $p->getStatic());
                    
38        $this->assertEquals(array('trim', 'json_encode'), $p->getFilters());
                    
                
FormTest.php https://gitlab.com/crazybutterfly815/magento2 | PHP | 268 lines
                    
1<?php
                    
2/**
                    
11 */
                    
12class FormTest extends \PHPUnit_Framework_TestCase
                    
13{
                    
77        $form = $this->_getFormInstance($args);
                    
78        $this->assertContains($action, $form->getAction());
                    
79
                    
79
                    
80        $this->assertEquals($requestPath, $form->getElement('request_path')->getValue());
                    
81        $this->assertEquals($targetPath, $form->getElement('target_path')->getValue());
                    
82
                    
83        $this->assertTrue($form->getElement('target_path')->getData('disabled'));
                    
84    }
                    
90     * @magentoAppIsolation enabled
                    
91     * @magentoDataFixture Magento/Store/_files/core_fixturestore.php
                    
92     *
                    
                
MinifierTest.php https://gitlab.com/crazybutterfly815/magento2 | PHP | 252 lines
                    
1<?php
                    
2/**
                    
16 * @magentoDbIsolation enabled
                    
17 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
                    
18 */
                    
18 */
                    
19class MinifierTest extends \PHPUnit_Framework_TestCase
                    
20{
                    
84        $adapter = $this->objectManager->get('cssMinificationAdapter');
                    
85        $this->assertEquals(
                    
86            file_get_contents(dirname(__DIR__) . '/_files/static/expected/styles.magento.min.css'),
                    
102        $adapter = $this->objectManager->get('jsMinificationAdapter');
                    
103        $this->assertEquals(
                    
104            file_get_contents(dirname(__DIR__) . '/_files/static/expected/test.min.js'),
                    
115     * @param string $requestedUri
                    
116     * @param callable $assertionCallback
                    
117     * @throws \Magento\Framework\Exception\LocalizedException
                    
                
TaxTest.php https://gitlab.com/crazybutterfly815/magento2 | PHP | 281 lines
                    
1<?php
                    
2/**
                    
12 *
                    
13 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
                    
14 */
                    
14 */
                    
15class TaxTest extends \PHPUnit_Framework_TestCase
                    
16{
                    
22    /**
                    
23     * @var \PHPUnit_Framework_MockObject_MockObject
                    
24     */
                    
27    /**
                    
28     * @var \PHPUnit_Framework_MockObject_MockObject
                    
29     */
                    
32    /**
                    
33     * @var \PHPUnit_Framework_MockObject_MockObject
                    
34     */
                    
                
OrderInvoiceTest.php https://gitlab.com/crazybutterfly815/magento2 | PHP | 393 lines
                    
1<?php
                    
2/**
                    
27 * Class OrderInvoiceTest
                    
28 * @SuppressWarnings(PHPMD.TooManyFields)
                    
29 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
                    
30 */
                    
31class OrderInvoiceTest extends \PHPUnit_Framework_TestCase
                    
32{
                    
33    /**
                    
34     * @var ResourceConnection|\PHPUnit_Framework_MockObject_MockObject
                    
35     */
                    
38    /**
                    
39     * @var OrderRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject
                    
40     */
                    
43    /**
                    
44     * @var InvoiceDocumentFactory|\PHPUnit_Framework_MockObject_MockObject
                    
45     */
                    
                
AbstractDataTest.php https://gitlab.com/crazybutterfly815/magento2 | PHP | 373 lines
                    
1<?php
                    
2/**
                    
10/**
                    
11 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
                    
12 */
                    
12 */
                    
13class AbstractDataTest extends \PHPUnit_Framework_TestCase
                    
14{
                    
19
                    
20    /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\Stdlib\DateTime\TimezoneInterface */
                    
21    protected $_localeMock;
                    
22
                    
23    /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\Locale\ResolverInterface */
                    
24    protected $_localeResolverMock;
                    
25
                    
26    /** @var \PHPUnit_Framework_MockObject_MockObject | \Psr\Log\LoggerInterface */
                    
27    protected $_loggerMock;
                    
                
AutoParagraphTest.php https://gitlab.com/potion/librechan | PHP | 577 lines
                    
1<?php
                    
2
                    
13    {
                    
14        $this->assertResult(
                    
15            'Foobar',
                    
21    {
                    
22        $this->assertResult(
                    
23'Par 1
                    
31    {
                    
32        $this->assertResult(
                    
33'Par1
                    
43    {
                    
44        $this->assertResult(
                    
45'Par1
                    
57    {
                    
58        $this->assertResult(
                    
59'<b>Par1</b>
                    
                
DevelErrorHandlerTest.php https://gitlab.com/Drulenium-bot/devel | PHP | 213 lines
                    
1<?php
                    
2
                    
46    $error_handlers = \Drupal::config('devel.settings')->get('error_handlers');
                    
47    $this->assertEqual($error_handlers, [DEVEL_ERROR_HANDLER_STANDARD => DEVEL_ERROR_HANDLER_STANDARD]);
                    
48    $this->drupalGet('admin/config/development/devel');
                    
48    $this->drupalGet('admin/config/development/devel');
                    
49    $this->assertOptionSelected('edit-error-handlers', DEVEL_ERROR_HANDLER_STANDARD);
                    
50
                    
51    // Ensures that selecting the DEVEL_ERROR_HANDLER_NONE option no error
                    
52    // (raw or message) is shown on the site in case of php errors.
                    
53    $edit = [
                    
56    $this->drupalPostForm('admin/config/development/devel', $edit, t('Save configuration'));
                    
57    $this->assertText(t('The configuration options have been saved.'));
                    
58    $error_handlers = \Drupal::config('devel.settings')->get('error_handlers');
                    
58    $error_handlers = \Drupal::config('devel.settings')->get('error_handlers');
                    
59    $this->assertEqual($error_handlers, [DEVEL_ERROR_HANDLER_NONE => DEVEL_ERROR_HANDLER_NONE]);
                    
60    $this->assertOptionSelected('edit-error-handlers', DEVEL_ERROR_HANDLER_NONE);
                    
                
UndeployedMetaDataImplementation.php https://github.com/jacknicole/sugarcrm_dev.git | PHP | 211 lines
                    
1<?php
                    
2if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
                    
38
                    
39require_once 'modules/ModuleBuilder/MB/ModuleBuilder.php' ;
                    
40require_once 'modules/ModuleBuilder/parsers/views/AbstractMetaDataImplementation.php' ;
                    
40require_once 'modules/ModuleBuilder/parsers/views/AbstractMetaDataImplementation.php' ;
                    
41require_once 'modules/ModuleBuilder/parsers/views/MetaDataImplementationInterface.php' ;
                    
42require_once 'modules/ModuleBuilder/parsers/views/ListLayoutMetaDataParser.php' ;
                    
42require_once 'modules/ModuleBuilder/parsers/views/ListLayoutMetaDataParser.php' ;
                    
43require_once 'modules/ModuleBuilder/parsers/views/GridLayoutMetaDataParser.php' ;
                    
44require_once 'modules/ModuleBuilder/parsers/constants.php' ;
                    
60
                    
61    	// BEGIN ASSERTIONS
                    
62        if (! isset ( $this->_fileVariables [ $view ] ))
                    
65        }
                    
66        // END ASSERTIONS
                    
67
                    
                
LimitTestCase.php https://github.com/robertleeplummerjr/bluebox.git | PHP | 329 lines
                    
1<?php
                    
2/*
                    
18 * and is licensed under the LGPL. For more information, see
                    
19 * <http://www.phpdoctrine.org>.
                    
20 */
                    
28 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
                    
29 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
                    
30 * @category    Object Relational Mapping
                    
30 * @category    Object Relational Mapping
                    
31 * @link        www.phpdoctrine.org
                    
32 * @since       1.0
                    
64        $photos = $q->execute(array(1));
                    
65        $this->assertEqual($photos->count(), 3);            
                    
66        $this->assertEqual($q->getSqlQuery(), 
                    
75        $users = $q->execute();
                    
76        $this->assertEqual($users->count(), 5);
                    
77        $this->assertEqual($q->getSqlQuery(), "SELECT e.id AS e__id, e2.id AS e2__id, e2.address AS e2__address FROM entity e LEFT JOIN email e2 ON e.email_id = e2.id WHERE (e.type = 0) LIMIT 5");
                    
                
PMA_relation_cleanup_test.php https://gitlab.com/trungthao379/phpmyadmin | PHP | 511 lines
                    
1<?php
                    
2/* vim: set expandtab sw=4 ts=4 sts=4: */
                    
3/**
                    
4 * tests for relation_cleanup.lib.php
                    
5 *
                    
5 *
                    
6 * @package PhpMyAdmin-test
                    
7 */
                    
13
                    
14require_once 'libraries/database_interface.inc.php';
                    
15
                    
15
                    
16require_once 'libraries/relation.lib.php';
                    
17require_once 'libraries/relation_cleanup.lib.php';
                    
23 *
                    
24 * this class is for testing relation_cleanup.lib.php functions
                    
25 *
                    
                
string-util.cpp https://github.com/tstarling/hiphop-php.git | C++ | 461 lines
                    
2   +----------------------------------------------------------------------+
                    
3   | HipHop for PHP                                                       |
                    
4   +----------------------------------------------------------------------+
                    
6   +----------------------------------------------------------------------+
                    
7   | This source file is subject to version 3.01 of the PHP license,      |
                    
8   | that is bundled with this package in the file LICENSE, and is        |
                    
9   | available through the world-wide-web at the following url:           |
                    
10   | http://www.php.net/license/3_01.txt                                  |
                    
11   | If you did not receive a copy of the PHP license and are unable to   |
                    
12   | obtain it through the world-wide-web, please send a note to          |
                    
13   | license@php.net so we can mail you a copy immediately.               |
                    
14   +----------------------------------------------------------------------+
                    
16
                    
17#include "hphp/runtime/base/string-util.h"
                    
18#include <algorithm>
                    
                
FlatTest.php https://gitlab.com/yousafsyed/easternglamor | PHP | 391 lines
                    
1<?php
                    
2/**
                    
7
                    
8class FlatTest extends \PHPUnit_Framework_TestCase
                    
9{
                    
66        $result = $category->getCollection()->getAllIds();
                    
67        $this->assertNotEmpty($result);
                    
68        $this->assertTrue(is_array($result));
                    
86        $indexer->reindexAll();
                    
87        $this->assertTrue($indexer->isValid());
                    
88
                    
94        );
                    
95        $this->assertInstanceOf('Magento\Catalog\Model\ResourceModel\Category\Flat', $category->getResource());
                    
96        $this->checkCategoryData($category);
                    
111
                    
112        $this->assertInstanceOf('Magento\Catalog\Model\ResourceModel\Category\Flat', $category->getResource());
                    
113
                    
                
DeleteTest.php https://gitlab.com/yousafsyed/easternglamor | PHP | 241 lines
                    
1<?php
                    
2/**
                    
11
                    
12class DeleteTest extends \PHPUnit_Framework_TestCase
                    
13{
                    
106    /**
                    
107     * Executes the controller action and asserts non exception logic
                    
108     */
                    
150
                    
151        $this->assertSame($this->resultPage, $notification->execute());
                    
152    }
                    
154    /**
                    
155     * Executes the controller action and asserts with redirect for non valid token param
                    
156     */
                    
188
                    
189        $this->assertSame($this->resultRedirect, $notification->execute());
                    
190    }
                    
                
ReadTest.php https://gitlab.com/yousafsyed/easternglamor | PHP | 312 lines
                    
1<?php
                    
2/**
                    
11
                    
12class ReadTest extends \PHPUnit_Framework_TestCase
                    
13{
                    
19        $file = $this->getFileInstance('popup.csv');
                    
20        $this->assertTrue($file instanceof ReadInterface);
                    
21    }
                    
23    /**
                    
24     * Test for assertValid method
                    
25     * Expected exception for file that does not exist and file without access
                    
30     */
                    
31    public function testAssertValid($path)
                    
32    {
                    
36    /**
                    
37     * Data provider for testAssertValid
                    
38     *
                    
                
DynamicPageCacheIntegrationTest.php https://gitlab.com/reasonat/test8 | PHP | 126 lines
                    
1<?php
                    
2
                    
53    $this->drupalGet($url);
                    
54    $this->assertFalse($this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER), 'Response object returned: Dynamic Page Cache is ignoring.');
                    
55
                    
59    $this->drupalGet($url);
                    
60    $this->assertEqual('MISS', $this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER), 'Cacheable response object returned: Dynamic Page Cache is active, Dynamic Page Cache MISS.');
                    
61    $this->drupalGet($url);
                    
61    $this->drupalGet($url);
                    
62    $this->assertEqual('HIT', $this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER), 'Cacheable response object returned: Dynamic Page Cache is active, Dynamic Page Cache HIT.');
                    
63
                    
67    $this->drupalGet($url);
                    
68    $this->assertEqual('MISS', $this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER), 'Render array returned, rendered as HTML response: Dynamic Page Cache is active, Dynamic Page Cache MISS.');
                    
69    $this->drupalGet($url);
                    
69    $this->drupalGet($url);
                    
70    $this->assertEqual('HIT', $this->drupalGetHeader(DynamicPageCacheSubscriber::HEADER), 'Render array returned, rendered as HTML response: Dynamic Page Cache is active, Dynamic Page Cache HIT.');
                    
71
                    
                
hb-buffer-private.hh.func-sort-c.html https://gitlab.com/laf-intel/laf-llvm-pass | HTML | 164 lines
                    
122    <tr>
                    
123              <td class="coverFn"><a href="hb-buffer-private.hh.gcov.html#150">_ZN11hb_buffer_t10assert_varEjj</a></td>
                    
124              <td class="coverFnHi">21058</td>
                    
158    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
                    
159    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.12</a></td></tr>
                    
160  </table>
                    
                
string-buffer.h https://gitlab.com/alvinahmadov2/hhvm | C Header | 307 lines
                    
2   +----------------------------------------------------------------------+
                    
3   | HipHop for PHP                                                       |
                    
4   +----------------------------------------------------------------------+
                    
6   +----------------------------------------------------------------------+
                    
7   | This source file is subject to version 3.01 of the PHP license,      |
                    
8   | that is bundled with this package in the file LICENSE, and is        |
                    
9   | available through the world-wide-web at the following url:           |
                    
10   | http://www.php.net/license/3_01.txt                                  |
                    
11   | If you did not receive a copy of the PHP license and are unable to   |
                    
12   | obtain it through the world-wide-web, please send a note to          |
                    
13   | license@php.net so we can mail you a copy immediately.               |
                    
14   +----------------------------------------------------------------------+
                    
16
                    
17#ifndef incl_HPHP_STRING_BUFFER_H_
                    
18#define incl_HPHP_STRING_BUFFER_H_
                    
                
simpletest.php https://github.com/orchestra-io/sample-openx.git | PHP | 433 lines
                    
1<?php
                    
2    /**
                    
5     *	@subpackage	UnitTester
                    
6     *	@version	$Id: simpletest.php 7321 2007-06-05 09:08:01Z andrew.hill@openads.org $
                    
7     */
                    
12    if (version_compare(phpversion(), '5') >= 0) {
                    
13        require_once(dirname(__FILE__) . '/reflection_php5.php');
                    
14    } else {
                    
14    } else {
                    
15        require_once(dirname(__FILE__) . '/reflection_php4.php');
                    
16    }
                    
39         *    because the class is an abstract case that should
                    
40         *    not be run. Once PHP4 is dropped this will disappear
                    
41         *    as a public method and "abstract" will rule.
                    
205     *    test run. Makes things like error queues
                    
206     *    available to PHP event handlers, and also
                    
207     *    gets around some nasty reference issues in
                    
                
TraceableEventDispatcherTest.php https://bitbucket.org/larryg/powerhut.git | PHP | 241 lines
                    
1<?php
                    
2
                    
25
                    
26class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase
                    
27{
                    
45        $listeners = $dispatcher->getListeners('foo');
                    
46        $this->assertCount(1, $listeners);
                    
47        $this->assertSame($listener, $listeners[0]);
                    
49        $tdispatcher->removeListener('foo', $listener);
                    
50        $this->assertCount(0, $dispatcher->getListeners('foo'));
                    
51    }
                    
58        $tdispatcher->addListener('foo', $listener = function () { ; });
                    
59        $this->assertSame($dispatcher->getListeners('foo'), $tdispatcher->getListeners('foo'));
                    
60    }
                    
66
                    
67        $this->assertFalse($dispatcher->hasListeners('foo'));
                    
68        $this->assertFalse($tdispatcher->hasListeners('foo'));
                    
                
DomQuery.php https://github.com/Martin1982/IBMessagingWorkshopServer.git | PHP | 405 lines
                    
23/** @see PHPUnit_Framework_Constraint */
                    
24// require_once 'PHPUnit/Framework/Constraint.php';
                    
25
                    
38 */
                    
39class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit_Framework_Constraint
                    
40{
                    
147
                    
148        if (!in_array($assertType, $this->_assertTypes)) {
                    
149            // require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
                    
149            // require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
                    
150            throw new Zend_Test_PHPUnit_Constraint_Exception(sprintf('Invalid assertion type "%s" provided to %s constraint', $assertType, __CLASS__));
                    
151        }
                    
163                if (3 > $argc) {
                    
164                    // require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
                    
165                    throw new Zend_Test_PHPUnit_Constraint_Exception('No content provided against which to match');
                    
                
SSLEngineTest.java https://github.com/dekellum/jetty.git | Java | 371 lines
                    
9// The Apache License v2.0 is available at
                    
10// http://www.opensource.org/licenses/apache2.0.php
                    
11// You may elect to redistribute this code under either of these licenses.
                    
20
                    
21import static org.junit.Assert.assertEquals;
                    
22import static org.junit.Assert.assertNotNull;
                    
22import static org.junit.Assert.assertNotNull;
                    
23import static org.junit.Assert.assertTrue;
                    
24
                    
154
                    
155        assertTrue(response.length()>102400);
                    
156    }
                    
202                        // Check the response
                    
203                        assertEquals(String.format("responses %d %d",l,i),RESPONSE0+RESPONSE0+RESPONSE1,responses);
                    
204                    }
                    
                
FCDGeometrySource.h https://bitbucket.org/ardalanaz/dava.framework.git | C Header | 188 lines
                    
5	
                    
6	MIT License: http://www.opensource.org/licenses/mit-license.php
                    
7*/
                    
120		@param count The number of individual source values to contain in this source. */
                    
121	inline void SetValueCount(size_t count) { FUAssert(stride > 0, return); SetDataCount(count * stride); }
                    
122
                    
125		@return The source value. */
                    
126	inline const float* GetValue(size_t index) const { FUAssert(index < GetValueCount(), return NULL); return &sourceData.at(index * stride); } /**< See above. */
                    
127
                    
130		@param value The new value. */
                    
131	inline void SetValue(size_t index, const float* value) { FUAssert(index < GetValueCount(), return); for (size_t i = 0; i < stride; ++i) sourceData.set(stride * index + i, value[i]); }
                    
132
                    
                
ArrayCharacterStreamTest.php https://gitlab.com/ealexis.t/trends | PHP | 360 lines
                    
1<?php
                    
2
                    
95
                    
96        $this->assertIdenticalBinary(pack('C*', 0xD0, 0x94), $stream->read(1));
                    
97        $this->assertIdenticalBinary(
                    
99            );
                    
100        $this->assertIdenticalBinary(pack('C*', 0xD0, 0xBB), $stream->read(1));
                    
101        $this->assertIdenticalBinary(
                    
103            );
                    
104        $this->assertIdenticalBinary(pack('C*', 0xD1, 0x85), $stream->read(1));
                    
105
                    
105
                    
106        $this->assertSame(false, $stream->read(1));
                    
107    }
                    
140
                    
141        $this->assertEquals(array(0xD0, 0x94), $stream->readBytes(1));
                    
142        $this->assertEquals(array(0xD0, 0xB6, 0xD0, 0xBE), $stream->readBytes(2));
                    
                
ModelChecking.java https://bitbucket.org/wthys/groove.git | Java | 244 lines
                    
27
                    
28import rwth.i2.ltl2ba4j.model.IGraphProposition;
                    
29
                    
186    public static void nextColourScheme() {
                    
187    	assert (NEXT_FREE_COLOUR % 4 == 2) : "Faulty colour-scheme in use: constant for WHITE should be have value n*4+1";
                    
188    	CURRENT_WHITE = nextFreeColour();
                    
209    	boolean result = true;
                    
210    	for (IGraphProposition gp: transition.getLabels()) {
                    
211    		if (gp.getFullLabel().equals(SIGMA)) {
                    
                
core.clj https://github.com/tavisrudd/trammel.git | Clojure | 367 lines
                    
7; and distribution terms for this software are covered by the Eclipse
                    
8; Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
                    
9; which can be found in the file COPYING the root of this
                    
94   result the body of the contract is interwoven with `try`/`catch` blocks to catch
                    
95   and examine the contents of `AssertionErrors` and based on context rethrow them
                    
96   with more information.  At the moment this information only takes the form of a
                    
96   with more information.  At the moment this information only takes the form of a
                    
97   richer assertion message.
                    
98  "
                    
109                                         args))))
                    
110                   (catch AssertionError pre#
                    
111                     (throw (AssertionError. (str "Pre-condition failure: " ~message \newline (.getMessage pre#))))))]
                    
115             ret#))
                    
116          (catch AssertionError post#
                    
117            (throw (AssertionError. (str "Post-condition failure: " ~message \newline (.getMessage post#))))))))))
                    
                
JavascriptTest.php https://gitlab.com/crazybutterfly815/magento2 | PHP | 217 lines
                    
1<?php
                    
2/**
                    
10 */
                    
11class JavascriptTest extends \PHPUnit_Framework_TestCase
                    
12{
                    
15    /**
                    
16     * @var \Magento\PageCache\Block\Javascript|\PHPUnit_Framework_MockObject_MockObject
                    
17     */
                    
20    /**
                    
21     * @var \Magento\Framework\View\Element\Template\Context|\PHPUnit_Framework_MockObject_MockObject
                    
22     */
                    
25    /**
                    
26     * @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject
                    
27     */
                    
30    /**
                    
31     * @var \Magento\Framework\View\LayoutInterface|\PHPUnit_Framework_MockObject_MockObject
                    
32     */
                    
                
CompareTest.php https://gitlab.com/crazybutterfly815/magento2 | PHP | 317 lines
                    
48
                    
49        $this->assertSessionMessages(
                    
50            $this->equalTo(['You added product Simple Product 1 Name to the comparison list.']),
                    
53
                    
54        $this->assertRedirect();
                    
55
                    
64
                    
65        $this->assertRedirect($this->equalTo('http://localhost/index.php/catalog/product_compare/index/'));
                    
66
                    
121
                    
122        $this->assertContains('simple_product_2', $responseBody);
                    
123        $this->assertContains('Simple Product 2 Name', $responseBody);
                    
231
                    
232        $this->_assertCompareListEquals([$firstProductEntityId, $secondProductEntityId]);
                    
233    }
                    
                
CallbackTest.php https://bitbucket.org/Dal-Papa/is-340-publish-base.git | PHP | 223 lines
                    
1<?php
                    
2/**
                    
19 * @license    http://framework.zend.com/license/new-bsd     New BSD License
                    
20 * @version    $Id: CallbackTest.php 24593 2012-01-05 20:35:02Z matthew $
                    
21 */
                    
23// Call Zend_Form_Decorator_CallbackTest::main() if this source file is executed directly.
                    
24if (!defined("PHPUnit_MAIN_METHOD")) {
                    
25    define("PHPUnit_MAIN_METHOD", "Zend_Form_Decorator_CallbackTest::main");
                    
27
                    
28require_once 'Zend/Form/Decorator/Callback.php';
                    
29require_once 'Zend/Form/Element.php';
                    
40 */
                    
41class Zend_Form_Decorator_CallbackTest extends PHPUnit_Framework_TestCase
                    
42{
                    
50
                    
51        $suite  = new PHPUnit_Framework_TestSuite("Zend_Form_Decorator_CallbackTest");
                    
52        $result = PHPUnit_TextUI_TestRunner::run($suite);
                    
                
Autoload.php https://bitbucket.org/daveschwan/ronin-group.git | PHP | 248 lines
                    
78            'phpunit_extensions_grouptestsuite' => '/Extensions/GroupTestSuite.php',
                    
79            'phpunit_extensions_phpttestcase' => '/Extensions/PhptTestCase.php',
                    
80            'phpunit_extensions_phpttestcase_logger' => '/Extensions/PhptTestCase/Logger.php',
                    
80            'phpunit_extensions_phpttestcase_logger' => '/Extensions/PhptTestCase/Logger.php',
                    
81            'phpunit_extensions_phpttestsuite' => '/Extensions/PhptTestSuite.php',
                    
82            'phpunit_extensions_repeatedtest' => '/Extensions/RepeatedTest.php',
                    
85            'phpunit_framework_assert' => '/Framework/Assert.php',
                    
86            'phpunit_framework_assertionfailederror' => '/Framework/AssertionFailedError.php',
                    
87            'phpunit_framework_comparator' => '/Framework/Comparator.php',
                    
183            'phpunit_util_log_tap' => '/Util/Log/TAP.php',
                    
184            'phpunit_util_php' => '/Util/PHP.php',
                    
185            'phpunit_util_php_default' => '/Util/PHP/Default.php',
                    
185            'phpunit_util_php_default' => '/Util/PHP/Default.php',
                    
186            'phpunit_util_php_windows' => '/Util/PHP/Windows.php',
                    
187            'phpunit_util_printer' => '/Util/Printer.php',
                    
                
raw_event_retrieval_strategy_test.php https://gitlab.com/unofficial-mirrors/moodle | PHP | 345 lines
                    
1<?php
                    
2// This file is part of Moodle - http://moodle.org/
                    
27global $CFG;
                    
28require_once($CFG->dirroot . '/calendar/tests/helpers.php');
                    
29
                    
87        $events = $retrievalstrategy->get_raw_events(null, [0], null);
                    
88        $this->assertCount(2, $events);
                    
89
                    
96        $events = $retrievalstrategy->get_raw_events(null, [0], null);
                    
97        $this->assertCount(1, $events);
                    
98        $event = reset($events);
                    
98        $event = reset($events);
                    
99        $this->assertEquals('assign', $event->modulename);
                    
100    }
                    
212        $events = $retrievalstrategy->get_raw_events([$useroverridestudent->id], $groups, [$course->id]);
                    
213        $this->assertCount(1, $events);
                    
214        $event = reset($events);
                    
                
JGoogleDataPicasaAlbumTest.php https://github.com/Hackwar/joomla-platform.git | PHP | 526 lines
                    
1<?php
                    
2/**
                    
63		$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0';
                    
64		$_SERVER['REQUEST_URI'] = '/index.php';
                    
65		$_SERVER['SCRIPT_NAME'] = '/index.php';
                    
104	{
                    
105		$this->assertEquals($this->auth->authenticate(), $this->object->authenticate());
                    
106	}
                    
115	{
                    
116		$this->assertEquals($this->auth->isAuthenticated(), $this->object->isAuthenticated());
                    
117	}
                    
128		$result = $this->object->delete();
                    
129		$this->assertTrue($result);
                    
130	}
                    
140		$link = $this->object->getLink();
                    
141		$this->assertEquals($link, 'https://picasaweb.google.com/data/entry/api/user/12345678901234567890/albumid/0123456789012345678');
                    
142		$link = $this->object->getLink('self');
                    
                
questionusagebyactivity_test.php https://bitbucket.org/kudutest1/moodlegit.git | PHP | 284 lines
                    
1<?php
                    
2// This file is part of Moodle - http://moodle.org/
                    
29global $CFG;
                    
30require_once(dirname(__FILE__) . '/../lib.php');
                    
31require_once(dirname(__FILE__) . '/helpers.php');
                    
48        $quba->set_preferred_behaviour('deferredfeedback');
                    
49        $this->assertEquals('deferredfeedback', $quba->get_preferred_behaviour());
                    
50    }
                    
58        $quba->set_id_from_database(123);
                    
59        $this->assertEquals(123, $quba->get_id());
                    
60    }
                    
67        // Exercise SUT and verify
                    
68        $this->assertNotEmpty($quba->get_id());
                    
69    }
                    
79        // Verify.
                    
80        $this->assertEquals($slot, 1);
                    
81        $this->assertEquals('unit_test', $quba->get_owning_component());
                    
                
XsdTest.php https://gitlab.com/yousafsyed/easternglamor | PHP | 302 lines
                    
1<?php
                    
2/**
                    
9
                    
10class XsdTest extends \PHPUnit_Framework_TestCase
                    
11{
                    
69        $actualResult = $dom->validate($schema, $actualErrors);
                    
70        $this->assertEquals(empty($expectedErrors), $actualResult);
                    
71        $this->assertEquals($expectedErrors, $actualErrors);
                    
122     * @return array
                    
123     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
                    
124     */
                    
                
LexerTest.php https://bitbucket.org/cryofrost/portal.git | PHP | 234 lines
                    
1<?php
                    
2
                    
6
                    
7require_once __DIR__ . '/../../TestInit.php';
                    
8
                    
22
                    
23        $this->assertEquals(Lexer::T_IDENTIFIER, $token['type']);
                    
24        $this->assertEquals('u', $token['value']);
                    
32        $token = $lexer->lookahead;
                    
33        $this->assertEquals(Lexer::T_IDENTIFIER, $token['type']);
                    
34        $this->assertEquals('someIdentifier', $token['value']);
                    
42        $token = $lexer->lookahead;
                    
43        $this->assertEquals(Lexer::T_IDENTIFIER, $token['type']);
                    
44        $this->assertEquals('s0m31d3nt1f13r', $token['value']);
                    
51        $token = $lexer->lookahead;
                    
52        $this->assertEquals(Lexer::T_IDENTIFIER, $token['type']);
                    
53        $this->assertEquals('some_identifier', $token['value']);
                    
                
LockerTest.php https://gitlab.com/imamul68e/137619_PHP31 | PHP | 284 lines
                    
1<?php
                    
2
                    
17
                    
18class LockerTest extends \PHPUnit_Framework_TestCase
                    
19{
                    
34
                    
35        $this->assertTrue($locker->isLocked());
                    
36    }
                    
78        $repo = $locker->getLockedRepository();
                    
79        $this->assertNotNull($repo->findPackage('pkg1', '1.0.0-beta'));
                    
80        $this->assertNotNull($repo->findPackage('pkg2', '0.1.10'));
                    
183
                    
184        $this->assertTrue($locker->isFresh());
                    
185    }
                    
199
                    
200        $this->assertFalse($locker->isFresh());
                    
201    }
                    
                
OperationResponseParserTest.php https://gitlab.com/techniconline/kmc | PHP | 335 lines
                    
1<?php
                    
2
                    
27        $p->addVisitor('foo', $visitor);
                    
28        $this->assertSame($visitor, $this->readAttribute($p, 'factory')->getResponseVisitor('foo'));
                    
29    }
                    
38        $op->prepare()->setResponse(new Response(200, array('Content-Type' => 'application/xml'), '<F><B>C</B></F>'), true);
                    
39        $this->assertInstanceOf('SimpleXMLElement', $op->execute());
                    
40    }
                    
51        $result = $op->execute();
                    
52        $this->assertEquals(201, $result['code']);
                    
53        $this->assertEquals('Created', $result['phrase']);
                    
65        $result = $op->execute();
                    
66        $this->assertEquals(array(
                    
67            'baz'    => 'bar',
                    
81        $op->prepare()->setResponse(new Response(201), true);
                    
82        $this->assertInstanceOf('Guzzle\Http\Message\Response', $op->execute());
                    
83    }
                    
                
LogstashFormatterTest.php https://gitlab.com/ealexis.t/trends | PHP | 333 lines
                    
1<?php
                    
2
                    
15
                    
16class LogstashFormatterTest extends \PHPUnit_Framework_TestCase
                    
17{
                    
19    {
                    
20        \PHPUnit_Framework_Error_Warning::$enabled = true;
                    
21
                    
42
                    
43        $this->assertEquals("1970-01-01T00:00:00.000000+00:00", $message['@timestamp']);
                    
44        $this->assertEquals('log', $message['@message']);
                    
44        $this->assertEquals('log', $message['@message']);
                    
45        $this->assertEquals('meh', $message['@fields']['channel']);
                    
46        $this->assertContains('meh', $message['@tags']);
                    
46        $this->assertContains('meh', $message['@tags']);
                    
47        $this->assertEquals(Logger::ERROR, $message['@fields']['level']);
                    
48        $this->assertEquals('test', $message['@type']);
                    
                
peering3.php https://github.com/dcolish/zguide.git | PHP | 272 lines
                    
1<?php
                    
2/*
                    
6 */
                    
7include "zmsg.php";
                    
8
                    
44					//  Worker is supposed to answer us with our task id
                    
45					assert($zmsg->body() == $task_id);
                    
46				}
                    
76if($_SERVER['argc'] < 2) {
                    
77	echo "syntax: peering2 me {you}...", PHP_EOL;
                    
78    exit();
                    
98
                    
99printf ("I: preparing broker at %s... %s", $self, PHP_EOL);
                    
100
                    
115	$peer = $_SERVER['argv'][$argn];
                    
116	printf ("I: connecting to cloud backend at '%s'%s", $peer, PHP_EOL);
                    
117	$endpoint = sprintf("ipc://%s-cloud.ipc", $peer);
                    
                
MetatagFaviconsTagsTest.php https://gitlab.com/mohamed_hussein/prodt | PHP | 266 lines
                    
1<?php
                    
2
                    
237    $this->drupalGet('admin/config/search/metatag/global');
                    
238    $this->assertSession()->statusCodeEquals(200);
                    
239    $this->assertSession()->fieldExists('mask_icon[href]');
                    
239    $this->assertSession()->fieldExists('mask_icon[href]');
                    
240    $this->assertSession()->fieldExists('mask_icon[color]');
                    
241
                    
247    $this->submitForm($edit, 'Save');
                    
248    $this->assertSession()->pageTextContains('Saved the Global Metatag defaults.');
                    
249
                    
259    $this->submitForm($edit, 'Save');
                    
260    $this->assertSession()->pageTextContains('Saved the Global Metatag defaults.');
                    
261
                    
                
ComposerHookTest.php https://gitlab.com/mohamed_hussein/prodt | PHP | 153 lines
                    
78    $this->mustExec("composer install --no-ansi", $sut);
                    
79    $this->assertScaffoldedFile($sut . '/sites/default/default.settings.php', FALSE, 'Test version of default.settings.php from drupal/core');
                    
80    // Run composer required to add in the scaffold-override-fixture. This
                    
84    $stdout = $this->mustExec("composer require --no-ansi --no-interaction fixtures/drupal-assets-fixture:dev-master fixtures/scaffold-override-fixture:dev-master", $sut);
                    
85    $this->assertScaffoldedFile($sut . '/sites/default/default.settings.php', FALSE, 'scaffolded from the scaffold-override-fixture');
                    
86    // Make sure that the appropriate notice informing us that scaffolding
                    
115    $this->assertStringContainsString('Scaffolding files for fixtures/drupal-drupal', $stdout);
                    
116    $this->assertScaffoldedFile($sut . '/index.php', FALSE, 'Test version of index.php from drupal/core');
                    
117    $topLevelProjectDir = 'composer-hooks-nothing-allowed-fixture';
                    
138    $this->assertStringContainsString('- Copy [web-root]/index.php from assets/index.php', $stdout);
                    
139    $this->assertStringContainsString('- Copy [web-root]/update.php from assets/update.php', $stdout);
                    
140
                    
149    $this->assertStringContainsString('- Copy [web-root]/index.php from assets/index.php', $stdout);
                    
150    $this->assertStringNotContainsString('- Copy [web-root]/update.php from assets/update.php', $stdout);
                    
151  }
                    
                
FixtureTaskTest.php https://github.com/gustavor/lore.git | PHP | 403 lines
                    
1<?php
                    
2/**
                    
4 *
                    
5 * PHP 5
                    
6 *
                    
6 *
                    
7 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
                    
8 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
13 * @copyright     Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
14 * @link          http://cakephp.org CakePHP(tm) Project
                    
15 * @package       Cake.Test.Case.Console.Command.Task
                    
15 * @package       Cake.Test.Case.Console.Command.Task
                    
16 * @since         CakePHP(tm) v 1.3
                    
17 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
                    
375		$this->Task->expects($this->at(1))->method('createFile')
                    
376			->with($filename, new PHPUnit_Framework_Constraint_PCREMatch('/\<\?php/ms'));
                    
377
                    
                
AclVoteManagerTest.php https://github.com/wowo/FOSCommentBundle.git | PHP | 256 lines
                    
1<?php
                    
2
                    
23 */
                    
24class AclVoteManagerTest extends \PHPUnit_Framework_TestCase
                    
25{
                    
78
                    
79        $this->assertEquals($expectedResult, $result);
                    
80    }
                    
121
                    
122        $this->assertEquals($expectedResult, $result);
                    
123    }
                    
164
                    
165        $this->assertEquals($expectedResult, $result);
                    
166    }
                    
241
                    
242        $this->assertEquals($class, $result);
                    
243    }
                    
                
TestCase.php https://bitbucket.org/ksekar/campus.git | PHP | 351 lines
                    
34 */
                    
35require_once 'Zend/Cloud/QueueService/Factory.php';
                    
36
                    
46 */
                    
47abstract class Zend_Cloud_QueueService_TestCase extends PHPUnit_Framework_TestCase
                    
48{
                    
153
                    
154            // PHPUnit does an identical comparison for assertContains(), so we just
                    
155            // use assertTrue and in_array()
                    
195            $queueURL = $this->_commonQueue->createQueue('test-send-message');
                    
196            $this->assertNotNull($queueURL);
                    
197            $this->_wait();
                    
290            foreach ($receivedMessages1 as $receivedMessage1) {
                    
291                $this->assertEquals($message1, $receivedMessage1->getBody());
                    
292            }
                    
                
lib_test.php https://github.com/alanbarrett/moodle.git | PHP | 221 lines
                    
1<?php
                    
2// This file is part of Moodle - http://moodle.org/
                    
46        global $CFG;
                    
47        require_once($CFG->dirroot . '/mod/page/lib.php');
                    
48    }
                    
74        // 2 additional events thanks to completion.
                    
75        $this->assertCount(3, $events);
                    
76        $event = array_shift($events);
                    
78        // Checking that the event contains the expected values.
                    
79        $this->assertInstanceOf('\mod_page\event\course_module_viewed', $event);
                    
80        $this->assertEquals($context, $event->get_context());
                    
80        $this->assertEquals($context, $event->get_context());
                    
81        $moodleurl = new \moodle_url('/mod/page/view.php', array('id' => $cm->id));
                    
82        $this->assertEquals($moodleurl, $event->get_url());
                    
82        $this->assertEquals($moodleurl, $event->get_url());
                    
83        $this->assertEventContextNotUsed($event);
                    
84        $this->assertNotEmpty($event->get_name());
                    
                
sym.cpp https://gitlab.com/philipclaude/avro2 | C++ | 412 lines
                    
7// Licensed under The GNU Lesser General Public License, version 2.1
                    
8// See http://www.opensource.org/licenses/lgpl-2.1.php
                    
9//
                    
54  n_(M.n()) {
                    
55  avro_assert( M.m() == M.n() );
                    
56  data_.resize(nb());
                    
75	n_ = M.m();
                    
76	avro_assert( n_ == M.n() );
                    
77	for (index_t i = 0; i < n_; i++)
                    
95
                    
96	avro_assert( n_>=2 && n_<=4 );
                    
97
                    
213  }
                    
214  avro_assert( vnorm > tol );
                    
215
                    
                
CallGraph.cpp https://gitlab.com/brian0218/rk3188_r-box_android4.2.2_sdk | C++ | 337 lines
                    
46    ExternalCallingNode(0), CallsExternalNode(0) {
                    
47      initializeBasicCallGraphPass(*PassRegistry::getPassRegistry());
                    
48    }
                    
183  // Reset all node's use counts to zero before deleting them to prevent an
                    
184  // assertion from firing.
                    
185#ifndef NDEBUG
                    
217Function *CallGraph::removeFunctionFromModule(CallGraphNode *CGN) {
                    
218  assert(CGN->empty() && "Cannot remove function from call "
                    
219         "graph if it references other functions!");
                    
233void CallGraph::spliceFunction(const Function *From, const Function *To) {
                    
234  assert(FunctionMap.count(From) && "No CallGraphNode for function!");
                    
235  assert(!FunctionMap.count(To) &&
                    
249  
                    
250  assert((!F || F->getParent() == Mod) && "Function not in current module!");
                    
251  return CGN = new CallGraphNode(const_cast<Function*>(F));
                    
                
XmlUtilsTest.php https://gitlab.com/fabiorf/chat | PHP | 197 lines
                    
32        } catch (\InvalidArgumentException $e) {
                    
33            $this->assertContains('Document types are not allowed', $e->getMessage());
                    
34        }
                    
46        } catch (\InvalidArgumentException $e) {
                    
47            $this->assertContains('XSD file or callable', $e->getMessage());
                    
48        }
                    
60        $this->assertInstanceOf('DOMDocument', XmlUtils::loadFile($fixtures.'valid.xml', array($mock, 'validate')));
                    
61        $this->assertSame(array(), libxml_get_errors());
                    
62    }
                    
68        $this->assertSame(array(), libxml_get_errors());
                    
69        $this->assertInstanceOf('DOMDocument', XmlUtils::loadFile(__DIR__.'/../Fixtures/Util/invalid_schema.xml'));
                    
70        $this->assertSame(array(), libxml_get_errors());
                    
111    {
                    
112        $this->assertSame($expected, XmlUtils::phpize($value));
                    
113    }
                    
                
FigletTest.php https://github.com/MontmereLimited/zf2.git | PHP | 288 lines
                    
1<?php
                    
2/**
                    
25namespace ZendTest\Captcha;
                    
26use Zend\View\Renderer\PhpRenderer as View;
                    
27
                    
65    {
                    
66        $this->assertTrue($this->element->getCaptcha() instanceof \Zend\Captcha\Adapter);
                    
67    }
                    
77        $html = $this->element->render($this->getView());
                    
78        $this->assertContains($this->element->getName(), $html);
                    
79    }
                    
84        $expect = sprintf('type="hidden" name="%s\[id\]" value="%s"', $this->element->getName(), $this->captcha->getId());
                    
85        $this->assertRegexp("/<input[^>]*?$expect/", $html, $html);
                    
86        $expect = sprintf('type="text" name="%s\[input\]"', $this->element->getName());
                    
86        $expect = sprintf('type="text" name="%s\[input\]"', $this->element->getName());
                    
87        $this->assertRegexp("/<input[^>]*?$expect/", $html, $html);
                    
88    }
                    
                
 

Source

Language