The document defines a fib function that recursively calculates Fibonacci numbers and prints the 10th Fibonacci number. It then defines some unit tests for a Calculator class that test the add method by asserting the expected result. Finally, it defines some unit tests for a User class that test validating a user object.
Replacing dependents with doubles is a central part of testing that every developer has to master. This talk goes over the different types of doubles and explains their place in testing, how to implement them in a mainstream mocking framework, and which strategies or doubles to use in different message exchange scenarios between objects. After this talk you will have moved a step forward in your understanding of testing in the context of object oriented programming.
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonfRafael Dohms
As developers we write code everyday, only to frown at it a week after that. Why do we have such a hard time with code written by others and ourselves, this raging desire to rewrite everything we see? Writing code that survives the test of time and self judgment is a matter of clarity and simplicity. Let's talk about growing, learning and improving our code with calisthenics, readability and good design.
Performance and testing are just one aspect of code, to really be successful your code needs to be readable, maintainable and generally easier to comprehend and work with. This talk draws from my own experience in applying the techniques of object calisthenics and code readability, within an existing team. It will help you identify trouble areas, learn how to refactor them and train you to write better code in future projects avoiding common pitfalls.
How do you measure the quality of your code? Performance and testing are just one aspect of code, in order to meet deadlines and make maintenance quicker you also need your code to be readable, decoupled and generally easier to comprehend and work with. This talk will go over tips and exercises to help you identify trouble areas, refactor them and train you to write better code in future projects. Come make your code look and function better.
Software development is riddled with explicit and implicit costs. Every decision you make has a cost attached to it. When you're writing code, you're making an investment, the size of which will for a long time define the costs of your future growth. Making right decision about these investments is very tricky and the cost of wrong decisions might be crippling for both business and teams that support it.
Extreme Programming and Test Driven Development in particular are practices that are aiming at supporting development effort by making it easier to introduce change. That said, sometimes those tools can become a problem of its own when applied in the wrong way or for the wrong context. Understanding software cost forces is a very important skill of successful teams and something that helps understand how to apply XP and TDD in different contexts.
Presentation made at GTA meetup in 2012-02-07.
Object Calisthenics is a set of exercise rules to reach better code, maintainable, testable and readable.
Replacing dependents with doubles is a central part of testing that every developer has to master. This talk goes over the different types of doubles and explains their place in testing, how to implement them in a mainstream mocking framework, and which strategies or doubles to use in different message exchange scenarios between objects. After this talk you will have moved a step forward in your understanding of testing in the context of object oriented programming.
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonfRafael Dohms
As developers we write code everyday, only to frown at it a week after that. Why do we have such a hard time with code written by others and ourselves, this raging desire to rewrite everything we see? Writing code that survives the test of time and self judgment is a matter of clarity and simplicity. Let's talk about growing, learning and improving our code with calisthenics, readability and good design.
Performance and testing are just one aspect of code, to really be successful your code needs to be readable, maintainable and generally easier to comprehend and work with. This talk draws from my own experience in applying the techniques of object calisthenics and code readability, within an existing team. It will help you identify trouble areas, learn how to refactor them and train you to write better code in future projects avoiding common pitfalls.
How do you measure the quality of your code? Performance and testing are just one aspect of code, in order to meet deadlines and make maintenance quicker you also need your code to be readable, decoupled and generally easier to comprehend and work with. This talk will go over tips and exercises to help you identify trouble areas, refactor them and train you to write better code in future projects. Come make your code look and function better.
Software development is riddled with explicit and implicit costs. Every decision you make has a cost attached to it. When you're writing code, you're making an investment, the size of which will for a long time define the costs of your future growth. Making right decision about these investments is very tricky and the cost of wrong decisions might be crippling for both business and teams that support it.
Extreme Programming and Test Driven Development in particular are practices that are aiming at supporting development effort by making it easier to introduce change. That said, sometimes those tools can become a problem of its own when applied in the wrong way or for the wrong context. Understanding software cost forces is a very important skill of successful teams and something that helps understand how to apply XP and TDD in different contexts.
Presentation made at GTA meetup in 2012-02-07.
Object Calisthenics is a set of exercise rules to reach better code, maintainable, testable and readable.
Persistence is one of the most important part in a PHP project. Persisting data to a database came with PHP/FI and its MySQL support. From native extensions and PHP4 database abstraction libraries to PDO and modern ORM frameworks, you will (re)discover how persistence has evolved during the last decade. This talk will also introduce the future of data persistence with the growing success of alternative storage engines.
Silex is a brand new PHP 5.3 micro framework built on top of the Symfony2 de decoupled components. In this session, we will discover how to build and deploy powerful REST web services with such a micro framework and its embedded tools.
The first part of this talk will introduce the basics of the REST architecture. We fill focus on the main concepts of REST like HTTP methods, URIs and open formats like XML and JSON.
Then, we will discover how to deploy REST services using most of interesting Silex tools like database abstraction layer, template engine and input validation. We will also look at unit and functional testing frameworks with PHPUnit and HTTP caching with Edge Side Includes and Varnish support to improve performances.
How do you create applications with an incredible level of extendability without losing readability in the process? What if there's a way to separate concerns not only on the code, but on the service definition level? This talk will explore structural and behavioural patterns and ways to enrich them through tricks of powerful dependency injection containers such as Symfony2 DIC component.
Design Patterns avec PHP 5.3, Symfony et PimpleHugo Hamon
Cette conférence présente deux grands motifs de conception : l'observateur et l'injection de dépendance. Ce sujet allie à la fois théorie et pratique. Le composant autonome EventDispatcher de Symfony ainsi que le conteneur d'injection de dépendance Pimple sont mis à l'honneur avec des exemples pratiques d'usage. Ces cas pratiques combinent du code de l'ORM Propel ainsi que le composant autonome Zend\Search\Lucene du Zend Framework 2
This session introduces most well known design patterns to build PHP classes and objects that need to store and fetch data from a relational databases. The session will describe the difference between of the Active Record, the Table and Row Data Gateway and the Data Mapper pattern. We will also examine some technical advantages and drawbacks of these implementations. This talk will expose some of the best PHP tools, which ease database interactions and are built on top of these patterns.
This session is about rules & behavior at the place that holds the data. We will work our way up from value objects to services and consider the pro, con and grey area design choices along the way.
Do you want to learn what exactly the function of an aggregate is? Then join me for a discussion on boundaries, message passing, and role play.
Refactoring, Agile Entwicklung, Continuous Integration – all diese für nachhaltigen Erfolg wichtigen Vorgehensweisen setzen Erfahrung mit Unit Testing voraus. Abseits von den üblichen "Bowling"-Beispielen möchten wir gerne einen Crashkurs inkl. Best Practices für das erfolgreiche Unit Testing durchführen. Anhand eines Beispielprojekts auf Basis des Zend Frameworks werden wir nach der Installation von PHPUnit auf allen Notebooks gemeinsam eine kleine Applikation aufbauen, die durchgehend Test-driven entwickelt wird.
Conheça um pouco mais sobre Perl 6, uma linguagem de programação moderna, poderosa e robusta que permitirá que você escreva código de forma ágil e eficiente.
Back in the ’40s, Samuel Eilenberg and Saunders Mac Lane started developing an entire new branch of mathematics: Category Theory. This was 10 years after Lambda calculus and 10 years before Lisp. Mathematics offers a powerful and concise language; we can represent a lot of complexity with short equations like E=mc2.
This session will explore how programming can harness maths’ capacity for conciseness and expression, borrowing from Category Theory. We’ll discover algebraic data types that can impact the way we code tremendously. You’ll also learn about functors, monads, applicatives, semigroups and monoids and how they can be used in a PHP context.
Un gioco in cui vincono tutti o due piccioni con una fava ;)
Lavorare rivolti alla creazione di valore per il cliente e da questo ottenere una libreria quasi pronta per essere pubblicata
Slides from my talk at the GTA-PHP Meetup Group about getting mixed HTML / PHP code into objects using SOLID principles.
Meetup page: http://www.meetup.com/GTA-PHP-User-Group-Toronto/events/230656470/
Code is on github: https://github.com/zymsys/solid
Persistence is one of the most important part in a PHP project. Persisting data to a database came with PHP/FI and its MySQL support. From native extensions and PHP4 database abstraction libraries to PDO and modern ORM frameworks, you will (re)discover how persistence has evolved during the last decade. This talk will also introduce the future of data persistence with the growing success of alternative storage engines.
Silex is a brand new PHP 5.3 micro framework built on top of the Symfony2 de decoupled components. In this session, we will discover how to build and deploy powerful REST web services with such a micro framework and its embedded tools.
The first part of this talk will introduce the basics of the REST architecture. We fill focus on the main concepts of REST like HTTP methods, URIs and open formats like XML and JSON.
Then, we will discover how to deploy REST services using most of interesting Silex tools like database abstraction layer, template engine and input validation. We will also look at unit and functional testing frameworks with PHPUnit and HTTP caching with Edge Side Includes and Varnish support to improve performances.
How do you create applications with an incredible level of extendability without losing readability in the process? What if there's a way to separate concerns not only on the code, but on the service definition level? This talk will explore structural and behavioural patterns and ways to enrich them through tricks of powerful dependency injection containers such as Symfony2 DIC component.
Design Patterns avec PHP 5.3, Symfony et PimpleHugo Hamon
Cette conférence présente deux grands motifs de conception : l'observateur et l'injection de dépendance. Ce sujet allie à la fois théorie et pratique. Le composant autonome EventDispatcher de Symfony ainsi que le conteneur d'injection de dépendance Pimple sont mis à l'honneur avec des exemples pratiques d'usage. Ces cas pratiques combinent du code de l'ORM Propel ainsi que le composant autonome Zend\Search\Lucene du Zend Framework 2
This session introduces most well known design patterns to build PHP classes and objects that need to store and fetch data from a relational databases. The session will describe the difference between of the Active Record, the Table and Row Data Gateway and the Data Mapper pattern. We will also examine some technical advantages and drawbacks of these implementations. This talk will expose some of the best PHP tools, which ease database interactions and are built on top of these patterns.
This session is about rules & behavior at the place that holds the data. We will work our way up from value objects to services and consider the pro, con and grey area design choices along the way.
Do you want to learn what exactly the function of an aggregate is? Then join me for a discussion on boundaries, message passing, and role play.
Refactoring, Agile Entwicklung, Continuous Integration – all diese für nachhaltigen Erfolg wichtigen Vorgehensweisen setzen Erfahrung mit Unit Testing voraus. Abseits von den üblichen "Bowling"-Beispielen möchten wir gerne einen Crashkurs inkl. Best Practices für das erfolgreiche Unit Testing durchführen. Anhand eines Beispielprojekts auf Basis des Zend Frameworks werden wir nach der Installation von PHPUnit auf allen Notebooks gemeinsam eine kleine Applikation aufbauen, die durchgehend Test-driven entwickelt wird.
Conheça um pouco mais sobre Perl 6, uma linguagem de programação moderna, poderosa e robusta que permitirá que você escreva código de forma ágil e eficiente.
Back in the ’40s, Samuel Eilenberg and Saunders Mac Lane started developing an entire new branch of mathematics: Category Theory. This was 10 years after Lambda calculus and 10 years before Lisp. Mathematics offers a powerful and concise language; we can represent a lot of complexity with short equations like E=mc2.
This session will explore how programming can harness maths’ capacity for conciseness and expression, borrowing from Category Theory. We’ll discover algebraic data types that can impact the way we code tremendously. You’ll also learn about functors, monads, applicatives, semigroups and monoids and how they can be used in a PHP context.
Un gioco in cui vincono tutti o due piccioni con una fava ;)
Lavorare rivolti alla creazione di valore per il cliente e da questo ottenere una libreria quasi pronta per essere pubblicata
Slides from my talk at the GTA-PHP Meetup Group about getting mixed HTML / PHP code into objects using SOLID principles.
Meetup page: http://www.meetup.com/GTA-PHP-User-Group-Toronto/events/230656470/
Code is on github: https://github.com/zymsys/solid
Adding Dependency Injection to Legacy ApplicationsSam Hennessy
Dependency Injection (DI) is a fantastic technique, but what if you what to use dependency injection in your legacy application. Fear not! As someone who as done this very thing, I will show how you can successful and incrementally add DI to any application. I will present a number of recipes and solutions to common problems and give a tour of the various PHP DI projects and how they can help.
Est-ce que nous allons parler de gestion des ressources humaines au PHP tour ? Non, je vous vais vous parler des modèles anémiques et des modèles riches. Depuis des années frameworks et ORM nous conditionnent à utiliser des modèles anémiques, une classe avec de simples setters et getters. A travers l’histoire d’Estelle, une RH, qui veut une application pour gérer ses salariés, je vais vous montrer comment changer nos vieilles habitudes afin de nous focaliser sur le métier que nous implémentons. Nous verrons ensemble quels outils utiliser, comme par exemple, le design pattern command bus, l’opérateur NEW de doctrine pour vos Data Transfert Object dans une application Symfony.
Example de code : https://github.com/arnolanglade/code-me-hr
Your code sucks, let's fix it - DPC UnConRafael Dohms
How do you measure the quality of your code? Performance and testing are just one aspect of code, in order to meet deadlines and make maintenance quicker you also need your code to be readable, decoupled and generally easier to comprehend and work with. This talk will go over tips and exercises to help you identify trouble areas, refactor them and train you to write better code in future projects. Come make your code look and function better.
https://speakerdeck.com/willroth/50-laravel-tricks-in-50-minutes - origin
Laravel 5.1 raised the bar for framework documentation, but there's much, much more lurking beneath the surface. In this 50-minute session, we'll explore 50 (yes, 50!) high-leverage implementation tips & tricks that you just won't find in the docs: the IoC Container, Blade, Eloquent, Middleware, Routing, Commands, Queues, Events, Caching — we'll cover them all! Join us as we drink from the fire hose & learn to take advantage of everything that Laravel has to offer to build better software faster!
By the sum of PHPUnit assertion power and Symfony2 functional testing tools the developer can obtain a deep control on the developed application.
Here you can find some suggestions on how to leverage that power.
n 2010, I told everyone how to start unit testing Zend Framework applications. In 2011, let’s take this a step further by testing services, work flows and performance. Looking to raise the bar on quality? Let this talk be the push you need to improve your Zend Framework projects.
As presented at Dutch PHP Conference 2015, an introduction to command buses, how to implement your own in PHP and why they're both useful but unimportant.
Writing readable code is one of the most important aspects of web development. A developer should write code which another human is able to understand without the help of too many comments.
This talk will show you how to tidy up your code and write readable PHP.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
10. class CalculatorTest
extends PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->calc = new Calculator;
}
public function test_add_ ()
{
$result = $this->calc->add(1, 2);
$this->assertSame(3, $result);
}
}
11. class CalculatorTest
extends PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->calc = new Calculator;
}
public function test_add_ ()
{
$result = $this->calc->add(1, 2);
$this->assertSame(3, $result);
}
}
12. class CalculatorTest
extends PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->calc = new Calculator;
}
public function test_add_ ()
{
$result = $this->calc->add(1, 2);
$this->assertSame(3, $result);
}
}
13. class CalculatorTest
extends PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->calc = new Calculator;
}
public function test_add_ ()
{
$result = $this->calc->add(1, 2);
$this->assertSame(3, $result);
}
}
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25. public function test_isValid_ true()
{
$user = new User;
$user->setName('Yuya');
$user->setUrl('http://yuyat.jp/');
$user->setAge(24);
$this->assertTrue($user->isValid());
}
public function test_isValid_ false()
{
$user = new User;
$user->setName('Yuya');
$user->setUrl('http://yuyat.jp/');
$user->setAge(NULL);
$this->assertFalse($user->isValid());
}
26. public function test_isValid_ true()
{
$user = new User;
$user->setName('Yuya');
$user->setUrl('http://yuyat.jp/');
$user->setAge(24);
$this->assertTrue($user->isValid());
}
public function test_isValid_ false()
{
$user = new User;
$user->setName('Yuya');
$user->setUrl('http://yuyat.jp/');
$user->setAge(NULL);
$this->assertFalse($user->isValid());
}
27. public function test_isValid_ true()
{
$user = $this->createValidUser();
$this->assertTrue($user->isValid());
}
public function test_isValid_ false()
{
$user = $this->createValidUser();
$user->setAge(NULL);
$this->assertFalse($user->isValid());
}
28. public function test_isValid_ true()
{
$user = $this->createValidUser();
$this->assertTrue($user->isValid());
}
public function test_isValid_ false()
{
$user = $this->createValidUser();
$user->setAge(NULL);
$this->assertFalse($user->isValid());
}
29. public function test_isValid_ true()
{
$user = $this->createValidUser();
$this->assertTrue($user->isValid());
}
public function test_isValid_ false()
{
$user = $this->createValidUser();
$user->setAge(NULL);
$this->assertFalse($user->isValid());
}
30.
31. public function test_isValid_ false()
{
$user = $this->createValidUser();
$user->setAge(NULL);
$this->assertFalse($user->isValid());
$user = $this->createValidUser();
$user->setName(NULL);
$this->assertFalse($user->isValid());
}
32. public function test_isValid_ false()
{
$user = $this->createValidUser();
$user->setAge(NULL);
$this->assertFalse($user->isValid());
$user = $this->createValidUser();
$user->setName(NULL);
$this->assertFalse($user->isValid());
}
33. public function test_isValid_ false()
{
$user = $this->createValidUser();
$user->setAge(NULL);
$this->assertFalse($user->isValid());
$user = $this->createValidUser();
$user->setName(NULL);
$this->assertFalse($user->isValid());
}
34. public function test_isValid_ Null false()
{
$user = $this->createValidUser();
$user->setAge(NULL);
$this->assertFalse($user->isValid());
}
public function test_isValid_ Null false()
{
$user = $this->createValidUser();
$user->setName(NULL);
$this->assertFalse($user->isValid());
}
35. public function test_isValid_ Null false()
{
$user = $this->createValidUser();
$user->setAge(NULL);
$this->assertFalse($user->isValid());
}
public function test_isValid_ Null false()
{
$user = $this->createValidUser();
$user->setName(NULL);
$this->assertFalse($user->isValid());
}
41. public function test_isSsl_HTTPS true()
{
$_SERVER['HTTPS'] = 'on';
$this->assertTrue($this->request->isSsl());
}
public function test_isSsl_HTTPS false()
{
unset($_SERVER['HTTPS']);
$this->assertFalse($this->request->isSsl());
}
42. public function test_isSsl_HTTPS true()
{
$_SERVER['HTTPS'] = 'on';
$this->assertTrue($this->request->isSsl());
}
public function test_isSsl_HTTPS false()
{
unset($_SERVER['HTTPS']);
$this->assertFalse($this->request->isSsl());
}
43. public function test_isSsl_HTTPS true()
{
$_SERVER['HTTPS'] = 'on';
$this->assertTrue($this->request->isSsl());
}
public function test_isSsl_HTTPS false()
{
unset($_SERVER['HTTPS']);
$this->assertFalse($this->request->isSsl());
}
44. public function test_isSsl_HTTPS true()
{
$_SERVER['HTTPS'] = 'on';
$this->assertTrue($this->request->isSsl());
}
public function test_isSsl_HTTPS false()
{
unset($_SERVER['HTTPS']);
$this->assertFalse($this->request->isSsl());
}
45. class Request
{
public function __construct($server)
{
$this->_server = $server;
}
public function isSsl()
{
return $this->_server === 'on';
}
}
46. class Request
{
public function __construct($server)
{
$this->_server = $server;
}
public function isSsl()
{
return $this->_server === 'on';
}
}
47. public function test_isSsl_HTTPS true()
{
$request = new Request(array('HTTPS' => 'on'));
$this->assertTrue($request->isSsl());
}
public function test_isSsl_HTTPS false()
{
$request = new Request(array());
$this->assertFalse($request->isSsl());
}
48. public function test_isSsl_HTTPS true()
{
$request = new Request(array('HTTPS' => 'on'));
$this->assertTrue($request->isSsl());
}
public function test_isSsl_HTTPS false()
{
$request = new Request(array());
$this->assertFalse($request->isSsl());
}
49.
50.
51. class User
{
protected $_name;
protected $_birthday;
public function setName($name) { /*~*/ }
public function getName() { /*~*/ }
public function getAge() { /*~*/ }
public static function findByName($name) { /*~*/ }
public function save() { /*~*/ }
}
53. class User
{
protected $_name;
protected $_birthday;
public function setName($name) { /*~*/ }
public function getName() { /*~*/ }
public function getAge() { /*~*/ }
}
class UserMapper
{
public function findByName($name) { /*~*/ }
public function save(User $user) { /*~*/ }
}
54. $mapper = new UserMapper;
$user = $mapper->findByName('Bob');
$user->setName('Alice');
$mapper->save($user);
55. class User
{
protected $_name;
protected $_birthday;
public function setName($name) { /*~*/ }
public function getName() { /*~*/ }
public function getAge() { /*~*/ }
public static function findByName($name) { /*~*/ }
public function save() { /*~*/ }
}
56. class User
{
protected $_name;
protected $_birthday;
public function setName($name) { /*~*/ }
public function getName() { /*~*/ }
public function getAge() { /*~*/ }
public static function findByName($name) { /*~*/ }
public function save() { /*~*/ }
}
57. class User
{
protected $_name;
protected $_birthday;
public function setName($name) { /*~*/ }
public function getName() { /*~*/ }
public function getAge() { /*~*/ }
public static function findByName($name) { /*~*/ }
public function save() { /*~*/ }
}
58. class User
{
protected $_name;
protected $_birthday;
public function setName($name) { /*~*/ }
public function getName() { /*~*/ }
public function getAge() { /*~*/ }
public static function findByName($name) { /*~*/ }
public function save() { /*~*/ }
}
59. class User
{
protected $_name;
protected $_birthday;
public function setName($name) { /*~*/ }
public function getName() { /*~*/ }
public function getAge() { /*~*/ }
}
class UserMapper
{
public function findByName($name) { /*~*/ }
public function save(User $user) { /*~*/ }
}
60. class User
{
protected $_name;
protected $_birthday;
public function setName($name) { /*~*/ }
public function getName() { /*~*/ }
public function getAge() { /*~*/ }
}
class UserMapper
{
public function findByName($name) { /*~*/ }
public function save(User $user) { /*~*/ }
}
61. class User
{
protected $_name;
protected $_birthday;
public function setName($name) { /*~*/ }
public function getName() { /*~*/ }
public function getAge() { /*~*/ }
}
class UserMapper
{
public function findByName($name) { /*~*/ }
public function save(User $user) { /*~*/ }
}
62. class User
{
protected $_name;
protected $_birthday;
public function setName($name) { /*~*/ }
public function getName() { /*~*/ }
public function getAge() { /*~*/ }
}
class UserMapper
{
public function findByName($name) { /*~*/ }
public function save(User $user) { /*~*/ }
}
63. class Config
{
protected static $_instance;
private function __construct() {}
public static function getInstance()
{
if (empty(self::$_instance)) {
self::$_instance = new self;
}
return self::$_instance;
}
}