Skip to content

Instantly share code, notes, and snippets.

View bizmate's full-sized avatar

Diego Gullo bizmate

View GitHub Profile
@bizmate
bizmate / BehatAttachFile.md
Last active September 9, 2016 10:50 — forked from nickrealdini/BehatAttachFile.md
Selenium attachFile yields empty file handle?

When I attach a file manually my file has a size value, but if I run the behat test the file size is zero.

Manual Upload:

FileList {0: File, length: 1}
	0: File
		lastModified: 1472812418000
 lastModifiedDate: Fri Sep 02 2016 11:33:38 GMT+0100 (BST)
@bizmate
bizmate / InitialDbMigrationCommand.php
Created September 30, 2013 13:19 — forked from bmarston/InitialDbMigrationCommand.php
Let's say you're starting a new Yii project and you've already created the database schema for it using something like phpMyAdmin or MySQL Workbench. Now you want to create an initial database migration so you can put the schema under version control, but you don't want to manually write the Yii code to create the tables, indexes, and foreign ke…
<?php
class InitialDbMigrationCommand extends CConsoleCommand
{
public function run($args) {
$schema = $args[0];
$tables = Yii::app()->db->schema->getTables($schema);
$addForeignKeys = '';
$dropForeignKeys = '';